package com.ruoyi.web.controller.Api;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.Constant;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.sql.SqlUtil;
import com.ruoyi.system.V2.api.service.IApiService;
import com.ruoyi.system.V2.gameAttr.mapper.AccountAttrValueMapper;
import com.ruoyi.system.V2.gameAttr.mapper.GameAttributeMapper;
import com.ruoyi.system.V2.gameAttr.service.IAccountAttrValueService;
import com.ruoyi.system.V2.gameAttr.service.IGameAttrTemplateService;
import com.ruoyi.system.V2.gameAttr.service.IGameAttributeService;
import com.ruoyi.system.V2.gameInfo.service.IGameInfoService;
import com.ruoyi.system.V2.goodInfo.mapper.GoodsInfoImgMapper;
import com.ruoyi.system.V2.goodInfo.mapper.GoodsInfoMapper;
import com.ruoyi.system.V2.goodInfo.service.IGoodsInfoService;
import com.ruoyi.system.V2.inter.mapper.*;
import com.ruoyi.system.V2.inter.service.IApiTaskPoolService;
import com.ruoyi.system.V2.inter.service.ISupplyInfoService;
import com.ruoyi.system.V2.recycle.mapper.AttributeMapper;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.model.domain.*;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueDto;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueReq;
import com.ruoyi.system.model.dto.api.ApiGameInfoDto;
import com.ruoyi.system.model.mapper.AccountInfoMapper;
import com.ruoyi.system.model.mapper.FieldConfigMapper;
import com.ruoyi.system.model.mapper.SkinImgMapper;
import com.ruoyi.system.model.mapper.SkinMapper;
import com.ruoyi.system.model.service.AsyncService;
import com.ruoyi.system.model.service.IAccountInfoService;
import com.ruoyi.system.model.service.UploadService;
import com.ruoyi.system.outto.core.OutUrlConstant;
import com.ruoyi.system.outto.game.*;
import com.ruoyi.system.outto.goods.*;
import com.ruoyi.system.outto.service.IOutApi;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.token.vo.ApiResponse;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchtaskQueryRequest;
import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchtaskQueryResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.math.BigDecimal;
import java.net.URL;
import java.util.*;
import java.util.stream.Collectors;

//import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchDeleteRequest;
//import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchDeleteResponse;

@Slf4j
@RestController
@RequestMapping("open/api")
public class OpenApiController {


    @Resource
    private OutRecMapper outRecMapper;
    @Resource
    private InterRecMapper interRecMapper;
    @Resource
    private AccountInfoMapper accountInfoMapper;
    @Resource
    private SalePartnerMapper salePartnerMapper;
    @Resource
    private ApiTaskPoolMapper apiTaskPoolMapper;
    @Resource
    private IAccountInfoService accountInfoService;
    @Resource
    private ISysUserService userService;
    @Autowired
    private IOutApi iOutApi;
    @Resource
    private SelectPushMapper selectPushMapper;

    @Resource
    private FieldConfigMapper fieldConfigMapper;
    @Resource
    private AccountAttrValueMapper accountAttrValueMapper;

    @Autowired
    private ISysDictDataService dictDataService;
    @Resource
    private AttributeMapper attributeMapper;

    @Autowired
    IAccountAttrValueService accountAttrValueService;

    @Autowired
    IGameAttrTemplateService gameAttrTemplateService;

    @Autowired
    IGoodsInfoService goodsInfoService;

    @Autowired
    IGameInfoService gameInfoService;

    @Autowired
    IApiService apiService;

    @Autowired
    IGameAttributeService gameAttributeService;

    @Autowired
    private ZHUANAPI zhuanapi;

    @Autowired
    private MHWAPI mhwapi;

    @Autowired
    private IYX7881API iyx7881API;

    @Resource
    private JymdataMapper jymdataMapper;

    @Autowired
    RedisCache redisCache;

    @Autowired
    NEWIPANZHIAPI panzhiapi;

    @Autowired
    ISupplyInfoService supplyInfoService;

    @Autowired
    private AsyncService asyncService;

    @Resource
    private GoodsInfoMapper goodsInfoMapper;


    @Resource
    private GoodsInfoImgMapper goodsInfoImgMapper;
    @Autowired
    NEWCRAPI crapi;
    @Autowired
    NEWCYXAPI newcyxapi;
    @Autowired
    NEWBQWAPI newbqwapi;
    @Autowired
    NEWLSHENAPI newlshenapi;
    @Autowired
    NEWDGUAGUAAPI newdguaguaapi;
    @Autowired
    NEWIKGAPI newikgapi;
    @Autowired
    NEWWUYOUAPI newwuyouapi;
    @Autowired
    NEWSBOAPI newsboapi;
    @Autowired
    NEWIZJYAPI newizjyapi;
    @Autowired
    NEWYUDUAPI newyuduapi;
    @Autowired
    IJiaoYiMaoAPI iJiaoYiMaoAPI;
    @Autowired
    NEWQSHANAPI newqshanapi;
    @Autowired
    NEWIPXAPI newipxapi;
    @Autowired
    TAOHAOHAOAPI taohaohaoapi;
    @Autowired
    NEWMAITAOAPI newmaitaoapi;
    @Autowired
    NEWLXAPI newlxapi;
    @Autowired
    NEWLONGXIAAPI newlongxiaapi;
    @Autowired
    NEWIMMAPI newimmapi;
    @Autowired
    NEWLCAPI newlcapi;
    @Autowired
    NEWIYX915API newiyx915API;
    @Autowired
    NEWYXGAPI newiyxgapi;
    @Autowired
    NEWITQYIAPI newitqyiapi;
    @Autowired
    NEWLDAPI newldapi;
    @Autowired
    NEWLDV2API newldv2API;
    @Autowired
    DAISHOUWANAPI daishouwanapi;
    @Autowired
    NEWCRAPI newcrapi;
    @Autowired
    NEWQQTAPI newqqtapi;
    @Autowired
    NEWMAIGEHAOAPI newmaigehaoapi;
    @Autowired
    YUDUTESTAPI yudutestapi;
    @Autowired
    XINGSHIAPI xingshiapi;
    @Autowired
    IHuanHaoBaApi huanHaoBaApi;
    @Autowired
    IMaiHaoWanApi iMaiHaoWanApi;
    @Autowired
    INew7881Api iNew7881Api;
    @Autowired
    NEWCYTAPI newcytapi;
    @Autowired
    IKeJinShouApi iKeJinShouApi;
    @Autowired
    NEWIYQSAPI newiyqsapi;
    @Autowired
    NEWIPANZHIAPI newipanzhiapi;
    @Autowired
    PANGXIEApi pangxieApi;
    @Autowired
    NEWLXYAPI newlxyapi;
    @Autowired
    IJYYAPI ijyyapi;
    @Autowired
    MOFANGAPI mofangapi;
    @Autowired
    NEWKANGEHAOAPI newkangehaoapi;
    @Autowired
    AdapterApi adapterApi;
//    @GetMapping("/migrate")
//    public AjaxResult migrate(){
//        OutRec outRec = new OutRec();
//        outRec.setSalecode("CRR");
//        outRec.setInter("add");
//        List<OutRec> list = outRecMapper.selectOutRecList(outRec);
//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(95l);
////        List<Long> list1 = list.stream().map(OutRec::getAccountid).collect(Collectors.toList());
////        goodsInfoMapper.sele
//        for(OutRec o : list){
//            GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto = goodsInfoMapper.selectGoodsInfoAndAttrValueById(o.getAccountid());
//            newcrapi.delGame(goodsInfoAndAttrValueDto,salePartner);
//        }
//        return AjaxResult.success();
//    }


    /**
     * 设置LOLicon
     */
    @GetMapping("/setLolIcon")
    public void setLolIcon() {

        String heroList = "https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js?ts=2858558";
        String body = HttpRequest.get(heroList).execute().body();
        JSONObject jsonObject = JSONObject.parseObject(body);
        String hero = jsonObject.getString("hero");
        List<JSONObject> jsonObjects = JSONObject.parseArray(hero, JSONObject.class);
        for (JSONObject object : jsonObjects) {
            String heroId = object.getString("heroId");

            String scene = "v3_rUMx4x6hcMQmbwEspebFgUlr6RNQAXpWnVZYZdfqhyZR6iYHR114N3l7DBvaN1GWTgRV1Tbyenh_dHVYdgMZGNnGjgVvciljAWRoH3VFOMC0yQZ7WH2IRp3t-ysiV-sO";

            JSONObject data = new JSONObject();
            data.put("scene", scene);
            data.put("hero_id", heroId);

            String skinUrl = "https://mlol.qt.qq.com/go/battle_info/get_user_hero_skin?plat=ios&version=10000";

            String cookie = HttpRequest.post(skinUrl).header("User-Agent", "QTL/9.6.1 (iPhone; IOS 16.0; Scale/3.00)").header("content-type", "application/json")
                    .header("cookie", "userId=fe2887a4-6ec7-4ed5-b77c-2a61f348fcf7;tid=3BBF221A48B186E575876EED28D967473F8E6AC404101252023F778B3A52389D0A5D7E2C6D0AC7C3D6FB87BA2A25080C794B043BD57437090DB0A038253EAB7144E82E4BCA8B75717A29F1A12076B3F5CE02995D30B4B06C5F3AD888F4F1ABB202A8CB463F9349EAD39C3958897EAFA071022589C114856944BE2F23B42ECEAFA942C12CF378D3E2AF92B105D98A4D67A1636373C76BF6B8E7904E9EE218397A8D684CEF48EB76D93622207405911287")
                    .body(data.toJSONString()).execute().body();

            JSONObject jsonObject1 = JSONObject.parseObject(cookie);
            JSONObject data1 = jsonObject1.getJSONObject("data");
            String skin_list = data1.getString("skin_list");
            List<JSONObject> jsonObjects1 = JSONObject.parseArray(skin_list, JSONObject.class);
            for (JSONObject jsonObject2 : jsonObjects1) {
                String skin_id = jsonObject2.getString("skin_id");
                GameAttribute gameAttribute = new GameAttribute();
                gameAttribute.setGameName("英雄联盟");
                gameAttribute.setSid(skin_id);
                List<GameAttribute> list = gameAttributeMapper.selectGameAttributeList(gameAttribute);
                if (CollectionUtils.isEmpty(list)) {
                    System.out.println(jsonObject2.getString("skin_name"));

                    GameAttribute select = new GameAttribute();
                    select.setGameName("英雄联盟");

                    String quality = jsonObject2.getString("quality");
                    if (StringUtils.isNotEmpty(quality)) {
                        select.setFieldName(quality);
                    } else {
                        select.setFieldName("其他");
                    }
                    List<GameAttribute> list1 = gameAttributeMapper.selectGameAttributeList(select);
                    if (!CollectionUtils.isEmpty(list1)) {
                        GameAttribute gameAttribute1 = list1.get(0);
                        Long id = gameAttribute1.getId();
                        GameAttribute intsert = new GameAttribute();
                        intsert.setGameName(gameAttribute1.getGameName());
                        intsert.setSid(skin_id);
                        intsert.setParentId(id);
                        intsert.setGameId(gameAttribute1.getGameId());

                        String quality_icon = jsonObject2.getString("quality_icon");
                        String skin_name = jsonObject2.getString("skin_name").replace(" ", "");
                        String quality_font = jsonObject2.getString("quality_font");
                        if (StringUtils.isNotEmpty(quality_icon) && StringUtils.isNotEmpty(quality_font)) {
                            intsert.setRemark(quality_icon + "," + quality_font);
                        }
                        intsert.setFieldName(skin_name);
                        intsert.setSort(0);
                        intsert.setCreateTime(new Date());
                        gameAttributeService.insertGameAttribute(intsert);
                    }
                } else {
                    String quality_icon = jsonObject2.getString("quality_icon");
                    String quality_font = jsonObject2.getString("quality_font");
                    if (StringUtils.isNotEmpty(quality_icon) && StringUtils.isNotEmpty(quality_font)) {
                        GameAttribute gameAttribute1 = list.get(0);
                        gameAttribute1.setRemark(quality_icon + "," + quality_font);
                        gameAttributeMapper.updateGameAttribute(gameAttribute1);
                    }

                }
            }
        }

    }

    @GetMapping("/search")
    public AjaxResult search(Long id, Long config) {
        System.out.println("----------新增------------");
        iOutApi.add(id, config);
        return AjaxResult.success();
    }

    @GetMapping("/search1")
    public AjaxResult search1(Long id, Long config) {
        try {
            System.out.println("----------编辑------------");
            iOutApi.edit(id, config, 0L);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return AjaxResult.success();
    }

    @GetMapping("/search2")
    public AjaxResult search2(Long id, Long config) {
        try {
            System.out.println("----------删除------------");
            iOutApi.del(id, config, 0, null);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return AjaxResult.success();
    }

    @GetMapping("/downPhoto")
    public AjaxResult downPhoto() {
        installPhoto();
        return AjaxResult.success();
    }

    @GetMapping("/pushApi")
    public AjaxResult pushApi(@RequestParam Map<String, Object> params) {
        Long id = MapUtils.getLong(params, "id");
        Long config = MapUtils.getLong(params, "config");
        iOutApi.add(id, config);
//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
//        GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto = goodsInfoMapper.selectGoodsInfoAndAttrValueById(id);
//        adapterApi.addGame(goodsInfoAndAttrValueDto, salePartner);
        return AjaxResult.success();
    }

    @GetMapping("/pushApiEdit")
    public AjaxResult pushApiEdit(@RequestParam Map<String, Object> params) {
        Long id = MapUtils.getLong(params, "id");
        Long config = MapUtils.getLong(params, "config");
//        Long[] ids = {id};
////        iOutApi.add(ids, config);
//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
//        GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto = goodsInfoMapper.selectGoodsInfoAndAttrValueById(id);
//        adapterApi.editGame(goodsInfoAndAttrValueDto, salePartner);
        iOutApi.edit(id, config, null);
        return AjaxResult.success();
    }

    @GetMapping("/pushDelApi")
    public AjaxResult pushDelApi(@RequestParam Map<String, Object> params) {
        Long id = MapUtils.getLong(params, "id");
        Long config = MapUtils.getLong(params, "config");

        iOutApi.del(id, config, 0, null);

        return AjaxResult.success();
    }

//    @GetMapping("/pushApiEdit")
//    public AjaxResult pushApiEdit(@RequestParam Map<String, Object> params) {
//        Long id = MapUtils.getLong(params, "id");
//        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(id);
//        Long config = MapUtils.getLong(params, "config");
//        accountInfo.setConfigId(config);
//        iOutApi.edit(id, config,null);
//        return AjaxResult.success();
//    }
//
//    @GetMapping("/pushApiDelete")
//    public AjaxResult pushApiDelete(@RequestParam Map<String, Object> params) {
//        Long id = MapUtils.getLong(params, "id");
//        Long config = MapUtils.getLong(params, "config");
//        Long[] ids = {id};
//        iOutApi.del(ids, config, 0, null);
//        return AjaxResult.success();
//    }*-+

    @GetMapping("/parseGoodAtte")
    public AjaxResult parseGoodAtte() {

        Attribute attribute = new Attribute();
        attribute.setType("王者荣耀");
        attribute.setParentId(37491l);
        List<Attribute> attributeList = attributeMapper.selectAttributeList(attribute);

        GameAttribute gameAttribute = new GameAttribute();
        gameAttribute.setGameName("王者荣耀");
        List<GameAttribute> gameAttributes = gameAttributeService.selectGameAttributeList(gameAttribute);
        for (GameAttribute abu : gameAttributes) {
            for (Attribute attr : attributeList) {
                if (abu.getFieldName().contains(attr.getFieldName())) {
                    abu.setImgUrl(attr.getImgUrl());
                    gameAttributeService.updateGameAttribute(abu);
                }
            }
        }

        return AjaxResult.success();

    }

    @GetMapping("/oneKeyAttr")
    public AjaxResult oneKeyAttr() {

        AjaxResult result = new AjaxResult();
        String msg = "";

        //1、获取游戏
        //循环游戏获取属性
        //循环属性保存

        SysDictData sysDictData = new SysDictData();
        sysDictData.setDictType("game_type");
        sysDictData.setStatus(Constants.STR_0);
        List<SysDictData> sysDictDataList = dictDataService.selectDictDataList(sysDictData);

        for (SysDictData dictData : sysDictDataList) {
            FieldConfig fieldConfig = new FieldConfig();

            List<String> fieldTypes = new ArrayList<>();
            fieldTypes.add("radio");
            fieldTypes.add("checkbox");
            fieldConfig.setType(dictData.getDictValue());
            fieldConfig.setFieldTypes(fieldTypes);
            List<FieldConfig> fieldConfigs = fieldConfigMapper.selectFieldConfigList(fieldConfig);
            for (FieldConfig config : fieldConfigs) {
                Attribute attribute = new Attribute();
                attribute.setType(dictData.getDictValue());
                attribute.setParentId(0l);
                attribute.setFieldName(config.getFieldName());
                attribute.setFieldType(config.getFieldType());
                int i = attributeMapper.insertAttribute(attribute);
                if (StringUtils.isNotEmpty(config.getFieldValue())) {
                    String[] split = config.getFieldValue().split(",");
                    Arrays.asList(split).stream().forEach(s -> {
                        Attribute attr = new Attribute();
                        attr.setParentId(attribute.getId());
                        attr.setFieldName(s);
                        attr.setType(dictData.getDictValue());
                        attributeMapper.insertAttribute(attr);
                    });
                }
            }
            //区服  实名
            sysDictData.setDictType(dictData.getDictValue());
            sysDictData.setStatus(Constants.STR_0);
            sysDictDataList = dictDataService.selectDictDataList(sysDictData);
            if (!CollectionUtils.isEmpty(sysDictDataList)) {
                Attribute attributeR = new Attribute();
                attributeR.setType(dictData.getDictValue());
                attributeR.setParentId(0l);
                attributeR.setFieldName(dictData.getDictValue() + "区服");
                attributeR.setFieldType("regional");
                attributeMapper.insertAttribute(attributeR);
                for (SysDictData sysDic : sysDictDataList) {
                    Attribute attr = new Attribute();
                    attr.setParentId(attributeR.getId());
                    attr.setFieldName(sysDic.getDictValue());
                    attr.setType(dictData.getDictValue());
                    attributeMapper.insertAttribute(attr);
                }
            }

            sysDictData.setDictType(dictData.getDictValue() + "段位");
            sysDictData.setStatus(Constants.STR_0);
            sysDictDataList = dictDataService.selectDictDataList(sysDictData);
            if (!CollectionUtils.isEmpty(sysDictDataList)) {
                Attribute attributeR = new Attribute();
                attributeR.setType(dictData.getDictValue());
                attributeR.setParentId(0l);
                attributeR.setFieldName(dictData.getDictValue() + "实名");
                attributeR.setFieldType("checkbox");
                attributeMapper.insertAttribute(attributeR);
                for (SysDictData sysDic : sysDictDataList) {
                    Attribute attr = new Attribute();
                    attr.setParentId(attributeR.getId());
                    attr.setFieldName(sysDic.getDictValue());
                    attr.setType(dictData.getDictValue());
                    attributeMapper.insertAttribute(attr);
                }
            }
        }

        return result;
    }


    @Resource
    private SkinImgMapper skinImgMapper;
    @Resource
    private SkinMapper skinMapper;
    @Resource
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private UploadService uploadService;

    @GetMapping("/skinImg")
    public void skinImg() {

        String url = "https://ssl.kohsocialapp.qq.com:10001/play/h5getheroskinlist";

        List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataByType("yingdiToken");
        String token = sysDictDataList.get(0).getDictValue();

        Map<String, Object> head = new HashMap<>();

        head.put("content-type", "application/x-www-form-urlencoded");

        Map<String, Object> params = new HashMap<>();
        params.put("openId", "oFhrws8OqdftI_7819rEA4eYgMsU");
        params.put("userId", "493258559");
        params.put("token", token);
        params.put("cClientVersionName", "6.73.106");
        params.put("cSystemVersionCode", "23");
        params.put("uniqueRoleId", "145811826");

        String s = HttpUtils.doPostForm(url, params, head);
        JSONObject jsonObject = JSON.parseObject(s);
        JSONObject data = jsonObject.getJSONObject("data");
        //总皮肤列表
        String heroSkinConfList = data.getString("heroSkinConfList");

        List<String> classIds = new ArrayList<>();
        JSONObject heroSkinConfJson = JSON.parseObject(heroSkinConfList);
        for (String s1 : heroSkinConfJson.keySet()) {
            String string = heroSkinConfJson.getString(s1);
            JSONObject parseObject = JSON.parseObject(string);
            String szHeroTitle = parseObject.getString("szTitle");
            String szSmallIcon = parseObject.getString("szSmallIcon");
            String classType = parseObject.getString("classType");
            List<Integer> integers = JSON.parseArray(classType, Integer.class);

            Attribute attribute = new Attribute();
            attribute.setFieldName(szHeroTitle);
            if (Objects.nonNull(integers)) {
                if (Objects.nonNull(integers) && integers.contains(1)) {
                    attribute.setSort(0l);
                }

                if (Objects.nonNull(integers) && integers.contains(2)) {
                    attribute.setSort(1l);
                }
                if (Objects.nonNull(integers) && integers.contains(3)) {
                    attribute.setSort(2l);
                }

                if (Objects.nonNull(integers) && integers.contains(4)) {
                    attribute.setSort(3l);
                }

                if (Objects.nonNull(integers) && integers.contains(5)) {
                    attribute.setSort(4l);
                }

                if (Objects.nonNull(integers) && integers.contains(6)) {
                    attribute.setSort(5l);
                }

                if (Objects.nonNull(integers) && integers.contains(7)) {
                    attribute.setSort(6l);
                }
                URL url1 = null;
                try {
                    url1 = new URL(szSmallIcon);
                    BufferedImage image = ImageIO.read(url1.openStream());
                    byte[] bytes = ImgUntil.bufferedImageToByteArray(image);
                    String path = uploadService.upload2Qiniu(bytes, "test11" + UUIDGenerator.generate());

                    attribute.setType("王者荣耀");
                    attribute.setCfgType(0l);
                    attribute.setParentId(37491l);
                    attribute.setImgUrl(path);
                    attribute.setValuation(new BigDecimal(2));
                    attributeMapper.insertAttribute(attribute);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

//        Attribute attribute = new Attribute();
//        attribute.setRemark("skinList");
//        attribute.setType("王者荣耀");
//        List<Attribute> attributeList = attributeMapper.selectAttributeList(attribute);
//        for (Attribute attr : attributeList) {
//            Skin skin = new Skin();
//            skin.setTitle(attr.getFieldName());
//            List<Skin> skins = skinMapper.selectSkinList(skin);
//            if (!CollectionUtils.isEmpty(skins)){
//                SkinImg skinImg = new SkinImg();
//                skinImg.setSkinId(Integer.valueOf(skins.get(0).getSkinId().toString()));
//                List<SkinImg> skinImgs = skinImgMapper.selectSkinImgList(skinImg);
//                if (!CollectionUtils.isEmpty(skinImgs)){
//                    attr.setImgUrl(skinImgs.get(0).getImgUrl());
//                    attributeMapper.updateAttribute(attr);
//                }
//            }
//        }
    }

    @Autowired
    private IJYMAPI ijymapi;
    @Resource
    private JymtaskMapper jymtaskMapper;

//    @GetMapping("/xiajiaJym")
//    public void xiajiaJym(Long config) {
//
//        List<Jymtask> jymtasks = jymtaskMapper.selectJymtaskList(new Jymtask());
//        for (Jymtask jymtask : jymtasks) {
//            Long[] ids = {jymtask.getAccountid()};
//            iOutApi.del(ids, config, 0, null);
//        }
//    }


    private Long getGoodsId(Long batchId) {
        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, "34271243",
                "6d2b6fbcf0edaad65a8719c9e5b5d7ee");

        AlibabaJymItemExternalGoodsBatchtaskQueryRequest req = new AlibabaJymItemExternalGoodsBatchtaskQueryRequest();
        AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto obj1 =
                new AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto();
        obj1.setBatchId(batchId);
        req.setGoodsBatchTaskQuery(obj1);
        AlibabaJymItemExternalGoodsBatchtaskQueryResponse rsp = null;
        try {
            rsp = client.execute(req);
        } catch (ApiException e) {
            e.printStackTrace();
        }
        if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() != false) {
            AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchTaskResultDto result = rsp.getResult();
            if (result != null) {
                Long status = result.getStatus();
                if (status.intValue() == 3 || status.intValue() == 2) {
                    List<AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchSubTask> goodsBatchSubTaskList =
                            result.getGoodsBatchSubTaskList();
                    for (AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchSubTask goodsBatchSubTask :
                            goodsBatchSubTaskList) {
                        Long goodsId = goodsBatchSubTask.getGoodsId();
                        if (goodsId != null) {
                            return goodsId;
                        }
                    }
                }
            }
        }
        return null;
    }


//    @GetMapping("/upInter")
//    public void upInter() {
//
//
//        SelectPush selectPush = new SelectPush();
//        selectPush.setId(14l);
//        selectPush.setState("0");
//        Date date = DateUtils.parseDate("2023-01-01 00:00:00");
//        List<SelectPush> selectPushes = selectPushMapper.selectSelectPushList(selectPush);
//        if (!CollectionUtils.isEmpty(selectPushes)) {
//            for (SelectPush push : selectPushes) {
//                String config = push.getConfig();
//                String exids = push.getExids();
//                String games = push.getGames();
//                String superId = push.getSuperId();
//
//                AccountInfo accountInfo = new AccountInfo();
//                if (StringUtils.isNotEmpty(games)) {
//                    String[] split = games.split(",");
//                    accountInfo.setGames(Arrays.asList(split));
//                }
//
//                if (StringUtils.isNotEmpty(superId)) {
//                    String[] split = superId.split(",");
//                    List<String> collect =
//                            Arrays.asList(split).stream().filter(s -> StringUtils.isNotEmpty(s)).collect(Collectors.toList());
//                    accountInfo.setCreateIds(collect);
//                }
//
//                if (StringUtils.isNotEmpty(exids)) {
//                    String[] split = exids.split(",");
//                    accountInfo.setExsCreateId(Arrays.asList(split));
//                }
//                accountInfo.setPageSize(100);
////                accountInfo.setAccountType("2");
//                if (StringUtils.isEmpty(config)) {
//                    break;
//                } else {
//                    String[] split = config.split(",");
//                    Arrays.asList(split).stream().forEach(s -> {
//                        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
//
//                        accountInfo.setSalesName(salePartner.getSaleName());
//                        //获取3天前的当前时间
//                        Date beforDate = DateUtils.getBeforDate(3);
//                        accountInfo.setCreateTimeStart(date);
//                        accountInfo.setCreateTimeEnd(beforDate);
//                        accountInfo.setIntercount(5);
//
//                        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
//
//                        AccountInfo info = accountInfoList.get(0);
//
//                        if (Objects.nonNull(salePartner)) {
////                            List<Long> ids = accountInfoList.stream().map(a -> a.getId()).collect(Collectors.toList
////                            ());
////                            Long[] strings2 = ids.toArray(new Long[]{});
////                            iOutApi.add(strings2,Long.parseLong(s));
//
//                            //        for (AccountInfo info : accountInfoList) {
//                            //查询三天没卖出去的账号
//                            //调下架接口
//                            Long[] ids = {info.getId()};
//                            iOutApi.del(ids, salePartner.getId(), 1, null);
//                            System.out.println("开始" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,
//                                    DateUtils.getNowDate()));
//                            try {
//                                Thread.sleep(5000l);
//                            } catch (InterruptedException e) {
//                                e.printStackTrace();
//                            }
//                            System.out.println("结束" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,
//                                    DateUtils.getNowDate()));
//                            //暂停5s
//                            //调上架接口
//                            iOutApi.add(ids, salePartner.getId());
//                            Integer intercount = info.getIntercount();
//                            intercount++;
//                            info.setIntercount(intercount);
//                            accountInfoMapper.updateAccountInfo(info);
//                        }
//
//                    });
//
////                    try {
////                        Thread.sleep(10000);
////                    } catch (InterruptedException e) {
////                        e.printStackTrace();
////                    }
//                }
//            }
//        }
//
//
//    }

    @GetMapping("/delInter")
    public AjaxResult delInter(@RequestParam Map<String, Object> params) {

        AjaxResult result = new AjaxResult();
        String msg = "";

        Long config = MapUtils.getLong(params, "configId");

        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);

        OutRec outRec = new OutRec();
        outRec.setSalecode(salePartner.getSaleName());
        outRec.setErrCount(1);
        outRec.setInter("add");
        List<OutRec> outRecs = outRecMapper.selectOutRecList(outRec);
        for (OutRec rec : outRecs) {
            String accountId = rec.getAccountid().toString();
            interRecMapper.deleteInterAccount(accountId, salePartner.getSaleName());
            outRecMapper.deleteOutRecById(rec.getId());
            artRecMapper.deleteArtRecCode(Long.parseLong(accountId), config);
            if (salePartner.getSaleName().contains("JYM")) {
                jymtaskMapper.deleteJymtaskBySaleCode(salePartner.getSaleName());
            }
        }
        return result;
    }

    @Autowired
    private SBOAPI sboapi;
    @Autowired
    private IPANZHIAPI ipanzhiapi;

    @Autowired
    private YDDDApi ydddApi;

    @Autowired
    private BQWAPI bqwapi;

    @GetMapping("/push")
    public AjaxResult push(@RequestParam Map<String, Object> params) {

        AjaxResult result = new AjaxResult();
        String msg = "";

        Long id = MapUtils.getLong(params, "id");
        Long configId = MapUtils.getLong(params, "configId");
        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(configId);
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(id);

        ipanzhiapi.addGame(accountInfo, accountInfo.getCreateId(), salePartner);
//        AjaxResult result1 = ijymapi.delGame(accountInfo, accountInfo.getCreateId(), salePartner);

//

        //获取配置信息
//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(configId);
//        for (AccountInfo info : accountInfoList) {
//            //新增下架任务
//            ApiTaskPool apiTaskPool = new ApiTaskPool();
//            apiTaskPool.setCreateId(createId);
//            apiTaskPool.setType(Constant.DEL);
//            apiTaskPool.setSuperId(createId);
//            apiTaskPool.setConfig(String.valueOf(configId));
//            apiTaskPool.setStatus(1l);
//            apiTaskPool.setPartnerName(salePartner.getName());
//            apiTaskPool.setAccountId(info.getId());
//            apiTaskPool.setPartCode(salePartner.getSaleName());
//            apiTaskPoolMapper.insertApiTaskPool(apiTaskPool);
//        }

        return result;
    }

    @Autowired
    private IZJYAPI izjyapi;

    @Autowired
    private IApiTaskPoolService apiTaskPoolService;

    @GetMapping("/delAccount")
    public AjaxResult delAccount(@RequestParam Map<String, Object> params) {

        AjaxResult result = new AjaxResult();
        String msg = "";


        Long createId = MapUtils.getLong(params, "createId");
        Long configId = MapUtils.getLong(params, "configId");
        Integer saleStatus = MapUtils.getInteger(params, "saleStatus");

//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(configId);

        GoodsInfo goodsInfo = new GoodsInfo();


        goodsInfo.setCreateId(createId);
        goodsInfo.setSaleState(saleStatus);
        goodsInfo.setCreateTimeStart("2023-05-14 00:00:00");
        goodsInfo.setCreateTimeEnd(DateUtils.getTime());
        List<GoodsInfo> goodsInfoList = goodsInfoMapper.selectGoodsInfoList(goodsInfo);

        Long[] configs = {69l, 71l, 79l, 84l, 92l, 93l, 95l, 99l, 100l, 104l, 105l, 107l, 108l, 109l, 110l, 111l, 112l, 113l, 114l, 116l, 118l, 119l, 123l
                , 126l, 129l, 130l, 131l, 132l, 133l, 134l, 135l
        };

        for (GoodsInfo info : goodsInfoList) {
            Arrays.asList(configs).stream().forEach(c -> {
                iOutApi.del(info.getId(), c, 0, null);
            });
//            apiTaskPoolService.insertBacth(info.getId(), null, "del", info.getCreateId());
//            asyncService.excuTaskPool(info.getId(), null, Constant.del, goodsInfo.getCreateId(), 1l);
        }


        //获取供货商账号
//        AccountInfo accountInfo = new AccountInfo();
//        accountInfo.setSaleState(1);
//        accountInfo.setCreateId(createId);
//        List<Long> jsons = accountInfoMapper.bzon();
//
//        for (Long id : jsons) {
//            izjyapi.delGame(id,1l,salePartner);
//        }

        return result;
    }

    @Resource
    private ArtRecMapper artRecMapper;

    @GetMapping("/toRec")
    public AjaxResult toRec() {

        AjaxResult result = new AjaxResult();
        String msg = "";

        List<InterRec> interRecs = interRecMapper.selectInterRecList(new InterRec());
        for (InterRec interRec : interRecs) {
            ArtRec artRec = new ArtRec();
            String saleCode = interRec.getSaleCode();
            artRec.setCreateId(interRec.getCreateId());
            artRec.setType("add");
            artRec.setAccountId(interRec.getAccountId());

            SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode(saleCode);
            if (Objects.nonNull(salePartner)) {
                artRec.setConfig(salePartner.getId());
                artRec.setSaleCode(salePartner.getSaleName());
                List<ArtRec> artRecs = artRecMapper.selectArtRecList(artRec);
                if (CollectionUtils.isEmpty(artRecs)) {
                    artRecMapper.insertArtRec(artRec);
                }
            }
        }

        return result;
    }


//    @GetMapping("/panzhiApi")
//    public AjaxResult panzhiApi(@RequestParam Map<String, Object> params) {
//
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//
////        Long createId = MapUtils.getLong(params, "createId")    ;
//        Long configId = MapUtils.getLong(params, "configId");
//
//        //获取供货商账号
//        InterRec interRec = new InterRec();
//        interRec.setSaleCode("PZZ");
//        List<InterRec> interRecs = interRecMapper.selectInterRecList(interRec);
//        for (InterRec rec : interRecs) {
//            AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(rec.getAccountId());
//            if (Objects.equals(accountInfo.getSaleState(), SalerStatus.unsold.getCode()) && -1 == accountInfo.getPrice().compareTo(new BigDecimal(500))) {
//                Long ids[] = {accountInfo.getId()};
//                iOutApi.add(ids, configId);
//            }
//        }
//
//        return result;
//    }

    @GetMapping("/delPriceAccount")
    public AjaxResult delPriceAccount(@RequestParam Map<String, Object> params) {

        AjaxResult result = new AjaxResult();
        String msg = "";

        Long createId = MapUtils.getLong(params, "createId");
        Long configId = MapUtils.getLong(params, "configId");


        //获取供货商账号
        AccountInfo accountInfo = new AccountInfo();
        accountInfo.setSaleState(1);
        accountInfo.setPriceStart(new BigDecimal(0));
        accountInfo.setPriceEnd(new BigDecimal(0));
        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);

        //获取配置信息
        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(configId);
        for (AccountInfo info : accountInfoList) {
            //新增下架任务
            ApiTaskPool apiTaskPool = new ApiTaskPool();
            apiTaskPool.setCreateId(createId);
            apiTaskPool.setType(Constant.DEL);
            apiTaskPool.setSuperId(createId);
            apiTaskPool.setConfig(String.valueOf(configId));
            apiTaskPool.setStatus(1l);
            apiTaskPool.setPartnerName(salePartner.getName());
            apiTaskPool.setAccountId(info.getId());
            apiTaskPool.setPartCode(salePartner.getSaleName());
            apiTaskPoolMapper.insertApiTaskPool(apiTaskPool);
        }

        return result;
    }


    @GetMapping("/wyImgBacth")
    public AjaxResult wyImgBacth() {

        AjaxResult result = new AjaxResult();
        String msg = "";
        accountInfoService.wyImgBacth(null);


        return result;
    }

//    @GetMapping("/execuDel")
//    public AjaxResult execuDel() {
//
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//        /**
//         * 1、循环任务池信息
//         * 2、调用接口任务，成功的，修改状态
//         */
//        ApiTaskPool apiTaskPool = new ApiTaskPool();
//        apiTaskPool.setStatus(1l);
//        apiTaskPool.setCountt(3);
//        List<ApiTaskPool> apiTaskPoolList = apiTaskPoolMapper.selectApiTaskPoolList(apiTaskPool);
//        for (ApiTaskPool taskPool : apiTaskPoolList) {
//            String type = taskPool.getType();
//            InterRec interRec = new InterRec();
//            interRec.setAccountId(taskPool.getAccountId());
//            interRec.setSaleCode(taskPool.getPartCode());
//            List<InterRec> interRecs = interRecMapper.selectInterRecList(interRec);
//            if (true) {
//                if (Constant.edit.equals(type)) {
//                    AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(taskPool.getAccountId());
//                    accountInfo.setConfigId(Long.parseLong(taskPool.getConfig()));
//                    iOutApi.edit(accountInfo, taskPool.getId());
//                }
//                if (Constant.del.equals(type)) {
//                    Long ids[] = {taskPool.getAccountId()};
//                    iOutApi.del(ids, Long.parseLong(taskPool.getConfig()), 1, taskPool.getId());
//                }
//            } else {
//                taskPool.setStatus(0l);
//                apiTaskPoolMapper.updateApiTaskPool(taskPool);
//            }
//        }
//
//
//        return result;
//    }


//    @GetMapping("/zhuanzhuanDel")
//    public AjaxResult zhuanzhuanDel() {
//
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//        /**
//         * 1、循环任务池信息
//         * 2、调用接口任务，成功的，修改状态
//         */
//
//
//        ApiTaskPool apiTaskPool = new ApiTaskPool();
//        apiTaskPool.setStatus(1l);
//        apiTaskPool.setType("del");
//        apiTaskPool.setPartnerName("终端--转转");
//        List<ApiTaskPool> apiTaskPools = apiTaskPoolMapper.selectApiTaskPoolList(apiTaskPool);
//        for (ApiTaskPool taskPool : apiTaskPools) {
//            String type = taskPool.getType();
//            OutRec outRec = new OutRec();
//            outRec.setInter("新增");
//            outRec.setSuccessCount(1);
//            outRec.setId(taskPool.getAccountId());
//            List<OutRec> outRecs = outRecMapper.selectOutRecList(outRec);
//            if (!CollectionUtils.isEmpty(outRecs)) {
//                if (Constant.edit.equals(type)) {
//                    AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(taskPool.getAccountId());
//                    accountInfo.setConfigId(Long.parseLong(taskPool.getConfig()));
//                    iOutApi.edit(accountInfo, taskPool.getId());
//                }
//                if (Constant.del.equals(type)) {
//                    Long ids[] = {taskPool.getAccountId()};
//                    iOutApi.del(ids, Long.parseLong(taskPool.getConfig()), 1, taskPool.getId());
//                }
//            } else {
//                taskPool.setStatus(0l);
//                apiTaskPoolMapper.updateApiTaskPool(taskPool);
//            }
//        }
//
////        AccountInfo accountInfo = new AccountInfo();
////        accountInfo.setSaleState(SalerStatus.sinceSale.getCode());
////        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
////        List<Long> sss = accountInfoList.stream().map(s -> s.getId()).collect(Collectors.toList());
////        Long[] array2 = sss.toArray(new Long[sss.size()]);
////        iOutApi.del(array2, null, 1, null);
//
////        SalePartner salePartner = new SalePartner();
////        salePartner.setStatus("1");
////        List<SalePartner> salePartners = salePartnerMapper.selectSalePartnerList(salePartner);
////        for (SalePartner partner : salePartners) {
////            InterRec interRec = new InterRec();
////            interRec.setSaleCode(partner.getSaleName());
////            List<InterRec> interRecs = interRecMapper.selectInterRecList(interRec);
////            List<Long> ids = interRecs.stream().map(s -> s.getAccountId()).collect(Collectors.toList());
////
////            List<Long> sss = accountInfoList.stream().map(s -> s.getId()).collect(Collectors.toList());
////            //type 1 保存入库记录  0 不保存入库记录
////            //public void del(Long[] ids, Long config, int type, Long id);
////            Long[] array2 = sss.toArray(new Long[sss.size()]);
////            iOutApi.del(array2, partner.getId(), 1, null);
////        }
//
//        return result;
//    }

//    @GetMapping("/zhuanzhuanDelConfig")
//    public AjaxResult zhuanzhuanDelConfig(@RequestParam Map<String, Object> params) {
//
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//        /**
//         * 1、循环任务池信息
//         * 2、调用接口任务，成功的，修改状态
//         */
//        Long config = MapUtils.getLong(params, "config");
//        SelectPush selectPush = selectPushMapper.selectSelectPushById(config);
//        String[] split = selectPush.getConfig().split(",");
//        if (!CollectionUtils.isEmpty(Arrays.asList(split))) {
//            long configId = Long.parseLong(split[0]);
//
//            AccountInfo accountInfo = new AccountInfo();
//            String[] split1 = selectPush.getSuperId().split(",");
//            accountInfo.setCreateIds(Arrays.asList(split1));
//            accountInfo.setSaleState(SalerStatus.sinceSale.getCode());
//            List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
//            List<Long> sss = accountInfoList.stream().map(s -> s.getId()).collect(Collectors.toList());
//            //type 1 保存入库记录  0 不保存入库记录
//            //public void del(Long[] ids, Long config, int type, Long id);
//            Long[] array2 = sss.toArray(new Long[sss.size()]);
//            iOutApi.del(array2, configId, 1, null);
//        }
//
//
//        return result;
//    }

//    @GetMapping("/delById")
//    public AjaxResult delById(@RequestParam Map<String, Object> params) {
//
//        Long id = MapUtils.getLong(params, "id");
//        Long config = MapUtils.getLong(params, "config");
//
//        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(id);
//        Long[] ids = {accountInfo.getId()};
//        iOutApi.del(ids, config, 0, null);
//
//        return AjaxResult.success();
//    }

    @Autowired
    private KEJINAPI kejinapi;

    @GetMapping("/kjscheck")
    public AjaxResult kjscheck() {

        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(71l);
        List<AccountInfo> accountInfoList = accountInfoMapper.kjscheck();
        for (AccountInfo accountInfo : accountInfoList) {
            kejinapi.delGame(accountInfo.getId(), accountInfo.getCreateId(), salePartner);
        }
        return AjaxResult.success();
    }

//    @GetMapping("/batchEdit")
//    public AjaxResult zhuanzhuanDel(@RequestParam Map<String, Object> params) {
//
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//
//        Long createId = MapUtils.getLong(params, "createId");
//        Long config = MapUtils.getLong(params, "config");
//        AccountInfo accountInfo = new AccountInfo();
//        accountInfo.setCreateId(createId);
//        accountInfo.setSaleState(SalerStatus.unsold.getCode());
//        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
//        for (AccountInfo info : accountInfoList) {
//            info.setConfigId(config);
//            iOutApi.edit(info, null);
//        }
////        System.out.println(accountInfoList.size());
////        List<Long> collect = accountInfoList.stream().filter(a -> (-1 == a.getPrice().compareTo(new BigDecimal(500)
////        ))).map(b -> b.getId()).collect(Collectors.toList());
////
////        for (AccountInfo info : accountInfoList) {
////            info.setConfigId(config);
////            iOutApi.edit(info, null);
////            if (StringUtils.isNotEmpty(info.getZid())) {
//////                info.setConfigId(Long.parseLong(selectPush.getConfig()));
////                iOutApi.edit(info, null);
////            }
////        }
//
////        Long[] strArray = collect.toArray(new Long[collect.size()]);
////        iOutApi.del(strArray, configId, 1, null);
////        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(31914l);
//        return result;
//    }

    @GetMapping("/batchShelves")
    public AjaxResult batchShelves(@RequestParam Map<String, Object> params) {
        AjaxResult result = new AjaxResult();
        String msg = "";

        Long createId = MapUtils.getLong(params, "createId");
        Long config = MapUtils.getLong(params, "config");
        Integer saleState = MapUtils.getInteger(params, "saleState");

        AccountInfo accountInfo = new AccountInfo();
        accountInfo.setSaleState(saleState);
        accountInfo.setCreateId(createId);

        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
        for (AccountInfo info : accountInfoList) {
//            iOutApi.del(id, config, 1, null);
            apiTaskPoolService.insertBacth(info.getId(), null, "del", accountInfo.getCreateId());
        }
        return result;
    }

    @GetMapping("/zhuanzhuanDelAll")
    public AjaxResult zhuanzhuanDelAll(@RequestParam Map<String, Object> params) {
        AjaxResult result = new AjaxResult();
        String msg = "";

        OutRec outRec = new OutRec();
        outRec.setRes("转转平台不卖");
        outRec.setInter("del");
        List<OutRec> outRecs = outRecMapper.selectOutRecList(outRec);

        Long id = MapUtils.getLong(params, "id");
        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(id);

        for (OutRec rec : outRecs) {
            AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(rec.getAccountid());
            zhuanapi.delGame(accountInfo, salePartner);
        }
        return result;
    }

//    @GetMapping("/xiajiazhuanzhuan")
//    public AjaxResult xiajiazhuanzhuan(@RequestParam Map<String, Object> params) {
//        AjaxResult result = new AjaxResult();
//        String msg = "";
//
//        Long id = MapUtils.getLong(params, "id");
//
//        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(id);
//
//        ArtRec artRec = new ArtRec();
//        artRec.setSaleCode(salePartner.getSaleName());
//        List<ArtRec> artRecs = artRecMapper.selectArtRecList(artRec);
//        for (ArtRec rec : artRecs) {
//            Long accountId = rec.getAccountId();
//            AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(accountId);
//            String[] noTaong = {"无二次", "包人脸"};
//            if (Objects.nonNull(accountInfo)) {
////                if (Arrays.asList(noTaong).contains(accountInfo.getLevel())){
//                accountInfo.setConfigId(id);
//                iOutApi.edit(accountInfo, null);
////                 Long[] ids = {accountId};
////                 iOutApi.del(ids, id,0,null);
////                }
//            }
//        }
//
////        Long id = MapUtils.getLong(params, "id");
////        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(id);
//
////        for (OutRec rec : outRecs) {
////            AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(rec.getAccountid());
////            zhuanapi.delGame(accountInfo, salePartner);
////        }
//        return result;
//    }


    @Autowired
    private LXYAPI lxyapi;
    @Autowired
    private ITQYIAPI itqyiapi;

    @GetMapping("/editApi")
    public AjaxResult editApi(@RequestParam Map<String, Object> params) {

        Long id = MapUtils.getLong(params, "id");
        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(21l);

        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(id);

        AjaxResult ajaxResult = lxyapi.editGame(accountInfo, accountInfo.getCreateId(), salePartner);

        return ajaxResult;
    }


//    @GetMapping("/editBachthApi")
//    public AjaxResult editBachthApi(@RequestParam Map<String, Object> params) {
//
////        Long config = MapUtils.getLong(params, "config");
//        Long createId = MapUtils.getLong(params, "createId");
//        Long id = MapUtils.getLong(params, "id");
////        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
//
//        SelectPush selectPush = selectPushMapper.selectSelectPushById(id);
//
//        String games = selectPush.getGames();
//        String superId = selectPush.getSuperId();
//        AccountInfo accountInfo = new AccountInfo();
//        String[] split = games.split(",");
//        accountInfo.setTypes(Arrays.asList(split));
//        String[] split1 = superId.split(",");
//        accountInfo.setCreateIds(Arrays.asList(split1));
//        accountInfo.setSaleState(1);
//
//        AjaxResult ajaxResult = new AjaxResult();
//        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
//        SysUser sysUser = userService.selectUserById(createId);
//        List<SysUser> supplyCustomer = new ArrayList<>();
//        supplyCustomer.add(sysUser);
////        List<SysUser> supplyCustomer = userService.getUserByRoleCode("supplyCustomer");
//        accountInfoService.bacthAcc(accountInfoList, supplyCustomer);
//        for (AccountInfo info : accountInfoList) {
//            info.setConfigId(Long.parseLong(selectPush.getConfig()));
//            iOutApi.edit(info, null);
//        }
//        return ajaxResult;
//    }


    @GetMapping("/zhuanzhuanZid")
    public AjaxResult zhuanzhuanZid() {

        String cookir = "id58=CigAAmQhRaNXMI0TfMccAg==; uid=1579074157486461440; childPpu=\"\"; childUid=\"\"; " +
                "from=undefined^undefined^undefined^undefined^0; referrerObj={\"refpagetype\":\"T4316\"," +
                "\"refpagequery\":\"\",\"refsubpageID\":\"\",\"refsectionId\":\"\",\"refsortId\":\"\"}; " +
                "idzz=CigAAmQhRaRXMI0TfMcvAg==; t=37; zz_t=37; tk=CigAAmQhRaRXMI0TfMcvAg==; expires=1679996442347; " +
                "PPU=\"TT=c4930c6217d08ac9a55ccaeca7947296bc14b4d7&UID=1579074157486461440&SF=ZHUANZHUAN&SCT" +
                "=1679913642061&V=1&ET=1682502042061\"; zzVisitStack=[{\"type\":\"popstate\",\"href\":\"b.zhuanzhuan" +
                ".com%2F%23%2Finfo%2Flist\",\"time\":1679910049845}]";

        AjaxResult result = new AjaxResult();
//        List<AccountInfo> accountInfoList = accountInfoMapper.zhuanzhuanZid();
//        List<Long> ids = accountInfoMapper.twoOutZz();
//        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(56979l);
//        AccountInfo accountInfo = accountInfoList.get(0);
        AccountInfo info = new AccountInfo();
        info.setSaleState(1);
//        info.setCreateId(555l);
//        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(info);
//        List<Long> ids = accountInfoList.stream().map(in -> in.getId()).collect(Collectors.toList());
//        for (Long accId : ids) {
        //1、查询列表
//        int i = 1;
        boolean flag = true;
        while (flag) {
            String listUrl = "https://dsyy.zhuanzhuan.com/getinfos?title=xyr" + "&uid=1579074157486461440&pageNum=1" +
                    "&pageSize=15&&_=1673431845622&status=1";

            Map<String, Object> params = new HashMap<>();
            params.put("title", "xyr");
            params.put("uid", "1579074157486461440");
            params.put("pageNum", "1");
            params.put("pageSize", "500");

            Map<String, String> head = new HashMap<>();
            head.put("cookie", cookir);
            String s = null;
            try {
                s = HttpUtils.sendPost(listUrl, JSON.toJSONString(params), head);
                System.out.println(s);
                JSONObject jsonObject = JSON.parseObject(s);
                JSONObject respData = jsonObject.getJSONObject("respData");
                String itemList = respData.getString("itemList");
                JSONArray objects = jsonObject.parseArray(itemList);
                for (Object object : objects) {
                    String string = JSON.toJSONString(object);
                    JSONObject jsonObject1 = JSON.parseObject(string);
                    String id = jsonObject1.getString("id");
                    String status = jsonObject1.getString("status");
                    System.out.println(string);
                    if ("1".equals(status)) {
                        String url = "https://dsyy.zhuanzhuan.com/offshelfbyid?infoId=" + id + "&reqUid" +
                                "=1579074157486461440&type=1&_=1673431845620";
                        Map<String, Object> publishparams = new HashMap<>();
                        publishparams.put("infoId", id);
                        publishparams.put("reqUid", "1579074157486461440");
                        publishparams.put("type", "1");
                        s = HttpUtils.sendPost(url, JSON.toJSONString(publishparams), head);
                        System.out.println(s);
                    }
                }
//                i ++;
                if (objects.size() < 1) {
                    flag = false;
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

//            accountInfo.setZid(null);
//            accountInfoMapper.updateAccountInfo(accountInfo);
//        }

        return result;
    }

//    /**
//     * 选择账号推送
//     */
//    @GetMapping("/selectPush")
//    public void selectPush(Integer pageSize, Long id) {
//
//        SelectPush selectPush = new SelectPush();
//        selectPush.setId(id);
//        selectPush.setState("0");
//        List<SelectPush> selectPushes = selectPushMapper.selectSelectPushList(selectPush);
//        if (!CollectionUtils.isEmpty(selectPushes)) {
//            for (SelectPush push : selectPushes) {
//                String config = push.getConfig();
//                String exids = push.getExids();
//                String games = push.getGames();
//                String superId = push.getSuperId();
//
//                AccountInfo accountInfo = new AccountInfo();
//                if (StringUtils.isNotEmpty(games)) {
//                    String[] split = games.split(",");
//                    accountInfo.setGames(Arrays.asList(split));
//                }
//
//                if (StringUtils.isNotEmpty(superId)) {
//                    String[] split = superId.split(",");
//                    List<String> collect =
//                            Arrays.asList(split).stream().filter(s -> StringUtils.isNotEmpty(s)).collect(Collectors.toList());
//                    accountInfo.setCreateIds(collect);
//                }
//
//                if (StringUtils.isNotEmpty(exids)) {
//                    String[] split = exids.split(",");
//                    accountInfo.setExsCreateId(Arrays.asList(split));
//                }
//                accountInfo.setPageSize(pageSize);
////                accountInfo.setAccountType("2");
//                if (StringUtils.isEmpty(config)) {
//                    break;
//                } else {
//                    String[] split = config.split(",");
//                    Arrays.asList(split).stream().forEach(s -> {
//                        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
//                        if (Objects.nonNull(salePartner)) {
//                            accountInfo.setSalesName(salePartner.getSaleName());
//                            List<AccountInfo> accountInfoList = accountInfoMapper.slectPushAcc(accountInfo);
//                            List<Long> ids = accountInfoList.stream().map(a -> a.getId()).collect(Collectors.toList());
//                            Long[] strings2 = ids.toArray(new Long[]{});
//                            iOutApi.add(strings2, Long.parseLong(s));
//                        }
//
//                    });
//                    try {
//                        Thread.sleep(10000);
//                    } catch (InterruptedException e) {
//                        e.printStackTrace();
//                    }
//                }
//            }
//        }
//    }

    @GetMapping(value = "testmhwadd/{infoid}", name = "测试买号玩添加")
    public AjaxResult testmhwadd(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("MHW");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = mhwapi.addGame(accountInfo, null, salePartner);
        return ajaxResult;
    }

    @GetMapping(value = "testmhwedit/{infoid}", name = "测试买号玩修改")
    public AjaxResult testmhwedit(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("MHW");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = mhwapi.editGame(accountInfo, null, salePartner);
        return ajaxResult;
    }

    @GetMapping(value = "testmhwdel/{infoid}", name = "测试买号玩删除")
    public AjaxResult testmhwdel(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("7881");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = mhwapi.delGame(accountInfo, null, salePartner);
        return ajaxResult;
    }


    @GetMapping(value = "test7881add/{infoid}", name = "测试7881发布")
    public AjaxResult test7881add(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("7881");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = iyx7881API.addGame(accountInfo, null, salePartner);
        return ajaxResult;
    }

    @GetMapping(value = "test7881edit/{infoid}", name = "测试7881修改")
    public AjaxResult test7881edit(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("7881");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = iyx7881API.editGame(accountInfo, null, salePartner);
        return ajaxResult;
    }


    @GetMapping(value = "test7881del/{infoid}", name = "测试7881删除")
    public AjaxResult test7881del(@PathVariable("infoid") Long infoid) {
        if (infoid == 0) {
            throw new GlobalException("传入infoid为空");
        }
        SalePartner salePartner = salePartnerMapper.selectSalePartnerSaleCode("MHW");
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        AjaxResult ajaxResult = iyx7881API.delGame(accountInfo, null, salePartner);
        return ajaxResult;
    }

    @GetMapping(value = "testaddattr/{infoid}", name = "测试attr")
    public AjaxResult testaddattr(@PathVariable("infoid") Long infoid) {
        AjaxResult result = new AjaxResult();
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoById(infoid);
        if (accountInfo != null) {
            AccountAttrValue accountAttrValue1 =
                    accountAttrValueMapper.selectAccountAttrValueByAccountInfoId(accountInfo.getId());
            accountAttrValue1.setId(1111l);
            int i = accountAttrValueService.insertAccountAttrValue(accountAttrValue1);
            System.out.println(i);
        }
        return result;
    }

    @GetMapping(value = "getGoodsInfo/{goodsId}", name = "查询goodsInfo")
    public AjaxResult getGoodsInfo(@PathVariable("goodsId") Long goodsId) {
        AjaxResult result = new AjaxResult();
        GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto = goodsInfoService.selectGoodsInfoAndAttrValueById(goodsId);
        return result;
    }

    @PostMapping(value = "addGoodsInfo", name = "添加goodsInfo")
    public AjaxResult addGoodsInfo(@RequestBody GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto) {
        AjaxResult result = new AjaxResult();
        goodsInfoService.insertGoodsInfoAndAttr(goodsInfoAndAttrValueDto);
        System.out.println("成功");
        return result;
    }

    @PostMapping(value = "editGoodsInfo", name = "添加goodsInfo")
    public AjaxResult editGoodsInfo(@RequestBody GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto) {
        AjaxResult result = new AjaxResult();
        if (goodsInfoAndAttrValueDto.getId() == null) {
            throw new GlobalException("商品id为null");
        }
        goodsInfoService.updateGoodsInfoAndAttr(goodsInfoAndAttrValueDto);
        System.out.println("成功");
        return result;
    }

    @GetMapping("/GoodsInfolist")
    public TableDataInfo list(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto) {
        startPage();
        List<GoodsInfoAndAttrValueDto> list = goodsInfoService.selectGoodsInfoAndAttrList(goodsInfoAndAttrValueDto);
        return getDataTable(list);
    }

    @GetMapping("/gameattrtemplate/list")
    public TableDataInfo gameattrtemplateList(GameAttrTemplate gameAttrTemplate) {
        List<GameAttrTemplate> list = gameAttrTemplateService.selectGameAttrTemplateList(gameAttrTemplate);
        return getDataTable(list);
    }

    @GetMapping("/game/attr/allList")
    public TableDataInfo gameattrtemplateList(GameAttribute gameAttribute) {
        List<GameAttribute> list = gameAttributeService.listAllTree(gameAttribute);
        return getDataTable(list);
    }

    @GetMapping("/GoodsInfoAlllist")
    public TableDataInfo alllist(GoodsInfoAndAttrValueReq goodsInfoAndAttrValueReq) {
        PageDomain pageDomain = TableSupport.buildPageRequest();
        List<GoodsInfo> list = goodsInfoService.selectByResList(goodsInfoAndAttrValueReq, pageDomain);
        return getDataTable(list);
    }

    @GetMapping(value = "gameInfo/{gameId}", name = "gameInfo")
    public ApiResponse getGameInfo(@PathVariable("gameId") Long gameId) {
        ApiGameInfoDto apiGameInfoDto = apiService.apiGetGameInfo(gameId);
        return ApiResponse.success(apiGameInfoDto);
    }

    @GetMapping(value = "gameAttrTemp/{gameId}", name = "gameInfo")
    public ApiResponse gameAttrTemp(@PathVariable("gameId") Long gameId) {
        List<ApiGameInfoDto> gameAttrTemplates = apiService.ApiGetGameField(gameId);
        return ApiResponse.success(gameAttrTemplates);
    }

    protected void startPage() {
        PageDomain pageDomain = TableSupport.buildPageRequest();
        Integer pageNum = pageDomain.getPageNum();
        Integer pageSize = pageDomain.getPageSize();
        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
            Boolean reasonable = pageDomain.getReasonable();
            PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
        }
    }

    /**
     * 响应请求分页数据
     */
    @SuppressWarnings({"rawtypes", "unchecked"})
    protected TableDataInfo getDataTable(List<?> list) {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("查询成功");
        rspData.setRows(list);
        rspData.setTotal(new PageInfo(list).getTotal());
        return rspData;
    }


    @GetMapping(value = "zhuanzhuandata")
    public AjaxResult zhuanzhuandata() {
        String URL = "https://app.zhuanzhuan.com/zzopen/gameAccount/accountRegionInfoList";

        Map<String, Object> parsm = new HashMap<>();
        parsm.put("pageSize", 20);
        parsm.put("pageNo", 1);
        parsm.put("isKind", "true");
        parsm.put("productType", 2123001);
        parsm.put("sysType", 1);
//        parsm.put("clientType",123001);
        parsm.put("pgCateId", 2123001);
//        parsm.put("pgBrandId",10874); 王者
//        parsm.put("pgBrandId",10877); //和平
//        parsm.put("pgBrandId",19522); //原神
        parsm.put("pgBrandId", 10875); //cf手游
        parsm.put("pgModelId", 0);
        parsm.put("queryOfficial", 10);
        parsm.put("metSource", "game--account_list--kingkong--hot-game-dynamic");
        parsm.put("sellerGuaranteePermanent", "0");
        parsm.put("fullText", "");
        parsm.put("publishTime", "0");
        parsm.put("sortType", "2");

        String tokenres = HttpUtils.doPostForm(URL, parsm, null);

        System.out.println(tokenres);
        JSONObject jsonObject = JSONObject.parseObject(tokenres);
        if (Objects.equals(jsonObject.getString("respCode"), "0")) {
            JSONObject respData = jsonObject.getJSONObject("respData");
            String productList = respData.getString("productList");
            List<JSONObject> jsonObjects = JSONObject.parseArray(productList, JSONObject.class);
            for (JSONObject object : jsonObjects) {

                String content = object.getString("content");
                String shopurl = "https://m.zhuanzhuan.com/platform/game_business/index" +
                        ".html?webview=zzn&init_from=2_5_14357_0&metric=mWrP8Y0I3N4W0zNVXVX7OQf406ayi&infoId=accouid" +
                        "&needHideHead=3&fromChannel=kingkong&b2cProduct=0&c2cVersion=c2c_new_v2&__zpm=1%5EO5742%5E8" +
                        "%5E0%5E0%7C3%5EW4951%5E203%5E3%5E0&tt=9F315A336A1E3A2789B24CF7690301A31680782957230&zzv=9.9" +
                        ".0&zzfrom=LinkCopy#/account/detail";
//                accouid
                String productId = object.getString("productId");
                shopurl.replace("accouid", productId);
                Jymdata jymdata = new Jymdata();
                jymdata.setDes(content);
                jymdata.setShopurl(shopurl);
                jymdata.setRecid(productId);
                jymdata.setShopid(productId);
                jymdata.setChannel("转转");
                jymdata.setGame("王者荣耀");

                Integer nowPrice = object.getInteger("nowPrice");
                if (Objects.nonNull(nowPrice)) {
                    jymdata.setPrice(String.valueOf(nowPrice / 100));
                }

                jymdata.setGame("王者荣耀");
                jymdataMapper.insertJymdata(jymdata);
            }
        }

        return AjaxResult.success();
    }

    public static void main(String[] args) {

//        delHouPangXie();
    }

    void installPhoto() {

        String savePath = "E:\\img\\永劫无间\\";

        GoodsInfo goodsInfo = new GoodsInfo();
        goodsInfo.setGameId(12l);
        List<GoodsInfo> goodsInfoList = goodsInfoMapper.selectGoodsInfoList(goodsInfo);
        for (GoodsInfo info : goodsInfoList) {
            GoodsInfoImg goodsInfoImg = new GoodsInfoImg();
            goodsInfoImg.setGoodsId(info.getId());
            List<GoodsInfoImg> goodsInfoImgList = goodsInfoImgMapper.selectGoodsInfoImgList(goodsInfoImg);
            for (GoodsInfoImg infoImg : goodsInfoImgList) {
                try {
                    DownloadPictureURL.downloadPicture(infoImg.getImgUrl(),infoImg.getFileName(),savePath);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

    }

    public static void taoshouyou() {


    }

    public static void delHouPangXie() {
        SalePartner salePartner = new SalePartner();
        salePartner.setSaleKey("zyl");
        salePartner.setOther("zyl123456");
        String token = getToken(salePartner);
        Map<String, Object> params = new HashMap<>();
        String[] strings = "11,13,12,26,39,33,142,32,25,36".split(",");
        int[] conditionArr = new int[]{1, 3};
        String string = "";
        while (true) {
            for (String s : strings) {
                for (int i = 0; i < conditionArr.length; i++) {
                    params.put("game_id", Integer.parseInt(s));
//                    params.put("unique_no_merchant", goodsInfoAndAttrValueDto.getThirdId());
                    params.put("condition", conditionArr[i]);
                    String url = "http://api-merchant.pxb7.com/business/product/plist";
                    String authorization = HttpRequest.post(url).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
                    String data1 = JSONObject.parseObject(authorization).getString("data");
                    string = JSONObject.parseObject(data1).getString("list");
                    try {
                        Object o = JSONArray.parseArray(string).get(0);
                        String id = JSONObject.parseObject(o.toString()).getString("id");
                        log.info(id);
                        Map<String, Object> delparams = new HashMap<>();
                        delparams.put("game_id", Integer.parseInt(s));
                        delparams.put("id", id);
                        String delurl = "http://api-merchant.pxb7.com/business/product/delete";
                        String responses = HttpRequest.post(delurl).header("Authorization", token).body(JSONObject.toJSONString(delparams)).execute().body();
                        System.out.println(responses);
                    } catch (Exception e) {

                    }
                }
            }
        }
    }

    static String getToken(SalePartner salePartner) {
        String url1 = "http://api-merchant.pxb7.com/business/login";
        Map<String, String> params1 = new HashMap<>();
        params1.put("user_name", salePartner.getSaleKey());
        params1.put("password", salePartner.getOther());
        String response = com.ruoyi.system.outto.dto.yx7881.utils.HttpUtil.doPost(url1, params1);
        JSONObject jsonObject = JSONObject.parseObject(response);
        if ("200".equals(jsonObject.getString("code"))) {
            String data = jsonObject.getString("data");
            JSONObject jsonObject1 = jsonObject.parseObject(data);
            log.info("token={}", jsonObject1.getString("token"));
            return jsonObject1.getString("token");
        }
        return null;
    }


    //导入氪金兽数据
//    @RequestMapping("/saveData")
    public AjaxResult saveData() {
        String request = "{\"status\":0,\"message\":\"获取成功\",\"data\":[{\"id\":333,\"title\":\"神品及战旗皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":3348,\"title\":\"初代玄女(宁红叶皮肤)\"},{\"id\":3349,\"title\":\"戎金狼(特木尔皮肤)\"},{\"id\":3352,\"title\":\"熛怒炼火(季沧海皮肤)\"},{\"id\":3350,\"title\":\"绝代风华(迦南皮肤)\"},{\"id\":3351,\"title\":\"沙漠香风(迦南皮肤)\"},{\"id\":3353,\"title\":\"蝶梦(胡桃皮肤)\"},{\"id\":3354,\"title\":\"海之奇(崔三娘皮肤)\"},{\"id\":3355,\"title\":\"青龙将星(岳山皮肤)\"},{\"id\":3356,\"title\":\"凌霄之羽(无尘皮肤)\"},{\"id\":3357,\"title\":\"香雪水兰(顾清寒皮肤)\"},{\"id\":3580,\"title\":\"暮光胴丸(武田信忠皮肤)\"},{\"id\":4628,\"title\":\"长天藏锦(殷紫萍皮肤)\"},{\"id\":6197,\"title\":\"化生明王(天海皮肤)\"},{\"id\":6198,\"title\":\"泣珠龙纱(崔三娘皮肤)\"},{\"id\":9425,\"title\":\"朱雀星衣(沈妙皮肤)\"},{\"id\":13154,\"title\":\"蛉魂梦使(妖刀姬皮肤)\"},{\"id\":16275,\"title\":\"夜魅游莹(季莹莹皮肤)\"},{\"id\":18312,\"title\":\"通天狐袄(玉玲珑皮肤)\"},{\"id\":23092,\"title\":\"化道者(哈迪皮肤)\"},{\"id\":23844,\"title\":\"赤皓新囍(宁红夜皮肤)\"},{\"id\":23847,\"title\":\"监兵凶神(胡为皮肤)\"},{\"id\":25833,\"title\":\"执明神君(魏轻皮肤)\"},{\"id\":25832,\"title\":\"比羿(横刀皮肤)\"},{\"id\":23846,\"title\":\"天罚(火炮皮肤)\"},{\"id\":23845,\"title\":\"飞将戟(斩马刀皮肤)\"},{\"id\":23091,\"title\":\"逆晦朔(扇皮肤)\"},{\"id\":18313,\"title\":\"天琼(匕首皮肤)\"},{\"id\":16276,\"title\":\"西行劫·如意金箍棒(棍皮肤)\"},{\"id\":13155,\"title\":\"2674·九阴(太刀皮肤)\"},{\"id\":9426,\"title\":\"涯角(枪皮肤)\"},{\"id\":6195,\"title\":\"少阳剑(长剑皮肤)\"},{\"id\":6196,\"title\":\"狂龙(双节棍皮肤)\"},{\"id\":4629,\"title\":\"烈阳(阔刀皮肤)\"},{\"id\":3581,\"title\":\"凤求凰(双刀皮肤)\"},{\"id\":3358,\"title\":\"冰魄(长剑皮肤)\"},{\"id\":3359,\"title\":\"灵狐幻刃(太刀皮肤)\"},{\"id\":3360,\"title\":\"狼主(阔刀皮肤)\"},{\"id\":3361,\"title\":\"灵犀(长枪皮肤)\"},{\"id\":3362,\"title\":\"毕方(弓箭皮肤)\"},{\"id\":3347,\"title\":\"墨离(飞索皮肤)\"},{\"id\":23651,\"title\":\"战旗雏鹰\"},{\"id\":23582,\"title\":\"战旗世界赛\"},{\"id\":13954,\"title\":\"战旗联盟\"},{\"id\":13953,\"title\":\"战旗入木三千劫\"},{\"id\":3609,\"title\":\"战旗cc\"},{\"id\":3607,\"title\":\"战旗斗鱼\"},{\"id\":3606,\"title\":\"战旗虎牙\"},{\"id\":3605,\"title\":\"战旗快手\"},{\"id\":3604,\"title\":\"战旗Twitch\"},{\"id\":3603,\"title\":\"战旗咏武\"},{\"id\":3602,\"title\":\"战旗bilibili\"},{\"id\":3601,\"title\":\"战旗抖音\"}]},{\"id\":1416,\"title\":\"谪星神品皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17220,\"title\":\"谪星·狼主\"},{\"id\":23093,\"title\":\"谪星·花重锦\"},{\"id\":18314,\"title\":\"谪星·通天狐袄\"},{\"id\":25830,\"title\":\"谪星·青霄玉女\"}]},{\"id\":1417,\"title\":\"谪星极品皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17221,\"title\":\"谪星·信手斩龙\"},{\"id\":18320,\"title\":\"谪星·2P\"},{\"id\":23094,\"title\":\"谪星·无定法\"},{\"id\":25831,\"title\":\"谪星·寻道\"}]},{\"id\":102,\"title\":\"宁红叶稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":6210,\"title\":\"玄豹姿\"},{\"id\":1799,\"title\":\"霜天红叶\"},{\"id\":613,\"title\":\"雪山天女\"},{\"id\":614,\"title\":\"碧水青天\"},{\"id\":615,\"title\":\"丹青墨意\"},{\"id\":616,\"title\":\"昆仑圣女\"},{\"id\":4568,\"title\":\"紫金玉女\"},{\"id\":15030,\"title\":\"2674·嘉斯威珀\"},{\"id\":17222,\"title\":\"耀世魂花\"},{\"id\":16420,\"title\":\"西行劫·蜘蛛精\"},{\"id\":5119,\"title\":\"夏日派对·午后瑰夏\"},{\"id\":4610,\"title\":\"梨园传奇·素贞\"},{\"id\":3508,\"title\":\"魔杰·傲昆仑\"},{\"id\":2354,\"title\":\"红川仙子\"},{\"id\":2164,\"title\":\"龙之道·自知\"},{\"id\":617,\"title\":\"九阴圣女\"},{\"id\":19448,\"title\":\"自动人形·2B\"},{\"id\":23850,\"title\":\"夜华朝\"}]},{\"id\":103,\"title\":\"特木尔稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":2245,\"title\":\"龙之影·龙虎斗\"},{\"id\":1802,\"title\":\"盖世冠军\"},{\"id\":585,\"title\":\"沙狼之怒\"},{\"id\":587,\"title\":\"狂狼之主\"},{\"id\":588,\"title\":\"苍狼之主\"},{\"id\":586,\"title\":\"头狼之心\"},{\"id\":589,\"title\":\"狂猎\"},{\"id\":590,\"title\":\"追猎\"},{\"id\":11314,\"title\":\"银狼裘\"},{\"id\":4569,\"title\":\"噬月天狼\"},{\"id\":3509,\"title\":\"魔杰·啸天狼\"},{\"id\":25576,\"title\":\"斗罗大陆·唐三\"},{\"id\":25834,\"title\":\"护世四法·多闻天王\"}]},{\"id\":99,\"title\":\"迦南稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":3510,\"title\":\"惊云羽\"},{\"id\":4616,\"title\":\"火罗圣女\"},{\"id\":2326,\"title\":\"浣烟纱\"},{\"id\":2166,\"title\":\"龙之道·求真\"},{\"id\":1804,\"title\":\"花无痕\"},{\"id\":581,\"title\":\"金羽圣鹰\"},{\"id\":1805,\"title\":\"蜃楼魅影\"},{\"id\":582,\"title\":\"月轮魅影\"},{\"id\":583,\"title\":\"璨银魔枭\"},{\"id\":584,\"title\":\"瀚海苍鹰\"},{\"id\":3463,\"title\":\"轩辕剑·拓跋玉儿\"},{\"id\":3583,\"title\":\"龙门·飞天\"},{\"id\":17223,\"title\":\"观山海·青鸟\"},{\"id\":17064,\"title\":\"西行劫·白骨夫人\"},{\"id\":11313,\"title\":\"红鹦袍\"},{\"id\":9431,\"title\":\"夜吻\"},{\"id\":6207,\"title\":\"神鹰之女\"},{\"id\":5571,\"title\":\"夏日派对·昭夏流金\"},{\"id\":23116,\"title\":\"长歌诗韵·胡旋女\"}]},{\"id\":104,\"title\":\"季沧海稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":2167,\"title\":\"龙之影·精武魂\"},{\"id\":4570,\"title\":\"夏日派对·椰风夕照\"},{\"id\":2246,\"title\":\"孽炎祸斗\"},{\"id\":592,\"title\":\"闻道\"},{\"id\":593,\"title\":\"逆水寒·江海沧澜\"},{\"id\":594,\"title\":\"逆水寒·江海羲炎\"},{\"id\":595,\"title\":\"立天地\"},{\"id\":596,\"title\":\"醉山川\"},{\"id\":597,\"title\":\"潜龙先锋\"},{\"id\":598,\"title\":\"江湖行\"},{\"id\":599,\"title\":\"游四海\"},{\"id\":3584,\"title\":\"瑞火麟\"},{\"id\":17224,\"title\":\"信手斩龙\"},{\"id\":13161,\"title\":\"2674·街头烈火\"},{\"id\":6206,\"title\":\"龙心炽焰\"},{\"id\":5832,\"title\":\"庖丁·食神\"},{\"id\":19452,\"title\":\"观山海·夏神祝融\"},{\"id\":23378,\"title\":\"逆水寒·染烟\"},{\"id\":25871,\"title\":\"护世四法·增长天王\"}]},{\"id\":105,\"title\":\"胡桃稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":18076,\"title\":\"新魔杰·辟邪帝姬\"},{\"id\":2168,\"title\":\"春桃笑\"},{\"id\":1810,\"title\":\"龙之道·至纯\"},{\"id\":1809,\"title\":\"天钿女命\"},{\"id\":601,\"title\":\"御宅罗梦(白丝)\"},{\"id\":602,\"title\":\"御宅花织(黑丝)\"},{\"id\":603,\"title\":\"主祭者\"},{\"id\":604,\"title\":\"阴阳姬\"},{\"id\":605,\"title\":\"清雅少女\"},{\"id\":606,\"title\":\"贵胄少女\"},{\"id\":3499,\"title\":\"承云兰寿\"},{\"id\":16419,\"title\":\"春日序曲·晨风\"},{\"id\":6203,\"title\":\"日道神子\"},{\"id\":4567,\"title\":\"辉烨少女\"},{\"id\":4566,\"title\":\"山吹茶\"},{\"id\":4565,\"title\":\"夏日派对·高校水着\"},{\"id\":23117,\"title\":\"长歌诗韵·遣唐使\"},{\"id\":25577,\"title\":\"斗罗大陆·小舞\"}]},{\"id\":106,\"title\":\"天海稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":1813,\"title\":\"龙之影·生死局\"},{\"id\":1388,\"title\":\"觉之一念\"},{\"id\":618,\"title\":\"枫行者\"},{\"id\":619,\"title\":\"净金宝相\"},{\"id\":620,\"title\":\"八宝龙王\"},{\"id\":621,\"title\":\"裟伽龙王\"},{\"id\":622,\"title\":\"谐之尊者\"},{\"id\":623,\"title\":\"不动明王\"},{\"id\":624,\"title\":\"持威明王\"},{\"id\":18077,\"title\":\"新魔杰·伏龙尊者\"},{\"id\":16421,\"title\":\"西行劫·悟净\"},{\"id\":9434,\"title\":\"若水尊者\"},{\"id\":4617,\"title\":\"梨园传奇·法海\"},{\"id\":23852,\"title\":\"武道无穷·少林\"}]},{\"id\":107,\"title\":\"妖刀姬稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":3511,\"title\":\"妖刀姬\"},{\"id\":625,\"title\":\"阴阳师赤影妖刀姬\"},{\"id\":626,\"title\":\"决战平安京·御神之刃\"},{\"id\":2169,\"title\":\"阴阳师·樱雨刀舞\"},{\"id\":3622,\"title\":\"决战平安京·热海白珊\"},{\"id\":5848,\"title\":\"决战平安京·神罚之光\"},{\"id\":9575,\"title\":\"决战平安京·朔夜游方\"},{\"id\":15900,\"title\":\"阴阳师·灼舞桃节\"},{\"id\":22932,\"title\":\"流火映真\"}]},{\"id\":108,\"title\":\"崔三娘稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":2327,\"title\":\"掌珠仙子\"},{\"id\":1814,\"title\":\"龙之道·无拘\"},{\"id\":2247,\"title\":\"伏波龙女\"},{\"id\":628,\"title\":\"怒浪\"},{\"id\":629,\"title\":\"镇海龙\"},{\"id\":3585,\"title\":\"蜇龙吟\"},{\"id\":15495,\"title\":\"巨鲸客\"},{\"id\":13162,\"title\":\"探海裙\"},{\"id\":6199,\"title\":\"赤雾烟霞\"},{\"id\":4618,\"title\":\"夏日派对·弄潮逐浪\"},{\"id\":19450,\"title\":\"观山海·文鳐\"},{\"id\":23379,\"title\":\"逆水寒·鸢纱\"}]},{\"id\":257,\"title\":\"岳山稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":18237,\"title\":\"新魔杰·斩魔天将\"},{\"id\":2355,\"title\":\"华夏宝甲·汉光\"},{\"id\":2171,\"title\":\"华夏宝甲·秦风\"},{\"id\":1817,\"title\":\"龙之影·过江龙\"},{\"id\":2328,\"title\":\"辉光\"},{\"id\":2330,\"title\":\"守誓者\"},{\"id\":1815,\"title\":\"神武\"},{\"id\":1816,\"title\":\"骁骑\"},{\"id\":3464,\"title\":\"轩辕剑·陈靖仇\"},{\"id\":16279,\"title\":\"西行劫·杨戬\"},{\"id\":9436,\"title\":\"常胜袍\"},{\"id\":7965,\"title\":\"百战·破荆者\"},{\"id\":6219,\"title\":\"弘毅袍\"},{\"id\":3550,\"title\":\"华夏宝甲·归义\"},{\"id\":3512,\"title\":\"魔杰·撼山岳\"},{\"id\":19901,\"title\":\"复制体·尼尔\"},{\"id\":23118,\"title\":\"长歌诗韵·戎关将\"}]},{\"id\":267,\"title\":\"无尘稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":6214,\"title\":\"朝闻道\"},{\"id\":3341,\"title\":\"仙剑奇侠传·李逍遥\"},{\"id\":3342,\"title\":\"未济袍\"},{\"id\":2329,\"title\":\"金羽客\"},{\"id\":2161,\"title\":\"金沙·梦蜀\"},{\"id\":2162,\"title\":\"若谷\"},{\"id\":2163,\"title\":\"通玄\"},{\"id\":4554,\"title\":\"玉衡天君\"},{\"id\":15902,\"title\":\"一品仙君\"},{\"id\":10764,\"title\":\"幽篁山鬼\"},{\"id\":9435,\"title\":\"灵鹿巫者\"},{\"id\":19449,\"title\":\"自动人形·9S\"},{\"id\":21032,\"title\":\"司天命\"},{\"id\":23686,\"title\":\"武道无穷·太极\"}]},{\"id\":278,\"title\":\"顾清寒稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17065,\"title\":\"西行劫·玄霜仙兔\"},{\"id\":3343,\"title\":\"仙剑奇侠传·赵灵儿\"},{\"id\":2350,\"title\":\"姑射真人\"},{\"id\":2351,\"title\":\"玄青郁离\"},{\"id\":4609,\"title\":\"梨园传奇·小青\"},{\"id\":9430,\"title\":\"金襦玉衫\"},{\"id\":6201,\"title\":\"赤丹朱湛\"},{\"id\":5118,\"title\":\"夏日派对·仲夏霜华\"},{\"id\":3513,\"title\":\"寒英素雪\"},{\"id\":15029,\"title\":\"2674·霜凝雪\"},{\"id\":15504,\"title\":\"藏雨阁主\"},{\"id\":15503,\"title\":\"畲族·凤凰装\"},{\"id\":18079,\"title\":\"富春山居·远山影\"},{\"id\":17066,\"title\":\"西行劫·玉兔精\"},{\"id\":19899,\"title\":\"自动人形·A2\"},{\"id\":23849,\"title\":\"寒烟素\"}]},{\"id\":1506,\"title\":\"玉玲珑稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":19453,\"title\":\"玄绶罗衣\"},{\"id\":19900,\"title\":\"复制体·凯妮\"},{\"id\":21034,\"title\":\"黄昏巫主\"},{\"id\":23684,\"title\":\"武道无穷·形意\"},{\"id\":23854,\"title\":\"日影花阴\"},{\"id\":25836,\"title\":\"护世四法·广目天王\"}]},{\"id\":382,\"title\":\"武田信忠稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17225,\"title\":\"斗魂\"},{\"id\":10753,\"title\":\"击浪\"},{\"id\":6217,\"title\":\"麟鹿大铠\"},{\"id\":5824,\"title\":\"花之倾奇\"},{\"id\":3515,\"title\":\"狮子丸\"},{\"id\":3514,\"title\":\"苍雷丸\"},{\"id\":21051,\"title\":\"枫狩\"}]},{\"id\":428,\"title\":\"殷紫萍稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":20765,\"title\":\"观山海·春神句芒\"},{\"id\":15505,\"title\":\"兰庭月\"},{\"id\":10763,\"title\":\"沐昭\"},{\"id\":7919,\"title\":\"春雪\"},{\"id\":6218,\"title\":\"新倩女幽魂·瑶光沐月\"},{\"id\":4589,\"title\":\"新倩女幽魂·流纨裙\"},{\"id\":4588,\"title\":\"新倩女幽魂·花间影\"},{\"id\":23119,\"title\":\"智绘·萍之缘\"}]},{\"id\":714,\"title\":\"沈妙稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":16278,\"title\":\"西行劫·紫衣仙子\"},{\"id\":13971,\"title\":\"2674·千机喵\"},{\"id\":10755,\"title\":\"絮云衣\"},{\"id\":7981,\"title\":\"绝伦袍\"},{\"id\":19451,\"title\":\"观山海·腓腓\"},{\"id\":21033,\"title\":\"绮云衫\"},{\"id\":23685,\"title\":\"武道无穷·咏春\"},{\"id\":23851,\"title\":\"街头狂欢·涂鸦少女\"},{\"id\":27921,\"title\":\"斗罗大陆·唐舞桐\"}]},{\"id\":983,\"title\":\"胡为稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":16277,\"title\":\"西行劫·悟空\"},{\"id\":17227,\"title\":\"观山海·秋神蓐收\"},{\"id\":15496,\"title\":\"行空裘\"},{\"id\":13159,\"title\":\"英雄袍\"},{\"id\":13158,\"title\":\"斑斓衣\"},{\"id\":23853,\"title\":\"街头狂欢·不败擂主\"},{\"id\":27920,\"title\":\"斗罗大陆·霍雨浩\"}]},{\"id\":1203,\"title\":\"季莹莹稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":16280,\"title\":\"无常白袍\"},{\"id\":17226,\"title\":\"观山海·冬神玄冥\"},{\"id\":20312,\"title\":\"百战·断链\"},{\"id\":23848,\"title\":\"武道无穷·八极\"},{\"id\":25835,\"title\":\"护世四法·持国天王\"}]},{\"id\":2014,\"title\":\"哈迪稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":23120,\"title\":\"沙海之鸠\"},{\"id\":23855,\"title\":\"夜绸袍\"},{\"id\":23856,\"title\":\"天工奥妙\"}]},{\"id\":2909,\"title\":\"魏轻稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":25837,\"title\":\"正法袍\"}]},{\"id\":101,\"title\":\"稀有飞索皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":3147,\"title\":\"飞鼠\"},{\"id\":608,\"title\":\"冰链\"},{\"id\":609,\"title\":\"毒刺\"},{\"id\":610,\"title\":\"铁护臂\"},{\"id\":611,\"title\":\"暗香\"},{\"id\":13972,\"title\":\"2674·游隼\"},{\"id\":23123,\"title\":\"长歌诗韵·五方狮\"}]},{\"id\":109,\"title\":\"长剑稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":18080,\"title\":\"富春山居·云山青\"},{\"id\":631,\"title\":\"壶中日月\"},{\"id\":632,\"title\":\"含光承影\"},{\"id\":1821,\"title\":\"华夏神兵·永乐宝剑\"},{\"id\":633,\"title\":\"阴阳师·伞剑\"},{\"id\":2172,\"title\":\"福禄双至\"},{\"id\":2331,\"title\":\"镇魔尺\"},{\"id\":2356,\"title\":\"冷香\"},{\"id\":3344,\"title\":\"锦鲤化龙·竹叶青\"},{\"id\":3465,\"title\":\"轩辕剑\"},{\"id\":4541,\"title\":\"破劫·腾云\"},{\"id\":16281,\"title\":\"西行劫·紫金宝剑\"},{\"id\":10754,\"title\":\"侠骨·清光引\"},{\"id\":9579,\"title\":\"跃龙门·寂兮\"},{\"id\":9578,\"title\":\"劫烬·炼\"},{\"id\":6220,\"title\":\"赤霄\"},{\"id\":4620,\"title\":\"烛神令\"},{\"id\":3516,\"title\":\"降龙木\"},{\"id\":19490,\"title\":\"复制体·月光与黑暗\"},{\"id\":21035,\"title\":\"监星尺\"},{\"id\":23860,\"title\":\"隐锋\"}]},{\"id\":110,\"title\":\"太刀稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":634,\"title\":\"雷赐\"},{\"id\":635,\"title\":\"数珠丸\"},{\"id\":636,\"title\":\"念珠丸\"},{\"id\":637,\"title\":\"阴阳师·鬼切\"},{\"id\":1822,\"title\":\"魂花晶\"},{\"id\":3148,\"title\":\"锦鲤化龙·落樱\"},{\"id\":3346,\"title\":\"锦鲤化龙·雅菊\"},{\"id\":3586,\"title\":\"樱华\"},{\"id\":4542,\"title\":\"破劫·炫日\"},{\"id\":3623,\"title\":\"破劫·洞幽\"},{\"id\":18081,\"title\":\"破劫·诛神之刃\"},{\"id\":15506,\"title\":\"金玉一文字\"},{\"id\":9577,\"title\":\"跃龙门·天劫\"},{\"id\":9433,\"title\":\"碎星河\"},{\"id\":5822,\"title\":\"劫烬·燎\"},{\"id\":5121,\"title\":\"风神切\"},{\"id\":19454,\"title\":\"自动人形·漆黑誓约\"},{\"id\":23121,\"title\":\"黑绳\"}]},{\"id\":111,\"title\":\"阔刀稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":4574,\"title\":\"听涛·强劲\"},{\"id\":639,\"title\":\"听涛\"},{\"id\":640,\"title\":\"暮影\"},{\"id\":641,\"title\":\"阴阳师·妖刀\"},{\"id\":642,\"title\":\"阴阳师·赤影妖刀\"},{\"id\":643,\"title\":\"决战平安京·不祥绯刃\"},{\"id\":2173,\"title\":\"阴阳师·落樱之刃\"},{\"id\":2345,\"title\":\"恶障\"},{\"id\":3149,\"title\":\"锦鲤化龙·炮烙\"},{\"id\":3587,\"title\":\"龙门·开伊阙\"},{\"id\":4555,\"title\":\"决战平安京·珊海之刃\"},{\"id\":5849,\"title\":\"决战平安京·神罚之刃\"},{\"id\":17121,\"title\":\"龙蟠\"},{\"id\":15901,\"title\":\"阴阳师·乱红之刃\"},{\"id\":13163,\"title\":\"阴阳师·魂梦残响\"},{\"id\":10757,\"title\":\"山君怒\"},{\"id\":9576,\"title\":\"决战平安京·朔方之刃\"},{\"id\":9557,\"title\":\"跃龙门·苍麟\"},{\"id\":7921,\"title\":\"鱼化龙\"},{\"id\":6208,\"title\":\"雷王锯\"},{\"id\":19455,\"title\":\"自动人形·纯白约定\"},{\"id\":22933,\"title\":\"赤云之刃\"},{\"id\":27919,\"title\":\"斗罗大陆·修罗\"}]},{\"id\":919,\"title\":\"斩马刀稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":16282,\"title\":\"西行劫·三尖两刃刀\"},{\"id\":15497,\"title\":\"白菜刀\"},{\"id\":13160,\"title\":\"护云狩\"},{\"id\":10756,\"title\":\"神龙刀\"},{\"id\":19457,\"title\":\"观山海·朱明\"},{\"id\":19904,\"title\":\"自动人形·三式战术长枪\"},{\"id\":25578,\"title\":\"斗罗大陆·昊天\"}]},{\"id\":112,\"title\":\"长枪稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":25579,\"title\":\"斗罗大陆·海神三叉戟\"},{\"id\":17858,\"title\":\"观山海·金神钺\"},{\"id\":16422,\"title\":\"西行劫·降妖宝杖\"},{\"id\":644,\"title\":\"阴阳师·月戟\"},{\"id\":645,\"title\":\"白虹\"},{\"id\":646,\"title\":\"九尺沁金耙\"},{\"id\":647,\"title\":\"正气扫帚\"},{\"id\":1827,\"title\":\"击苍穹\"},{\"id\":2332,\"title\":\"玄鲸骨叉\"},{\"id\":2174,\"title\":\"松月\"},{\"id\":2358,\"title\":\"委蛇矛\"},{\"id\":3345,\"title\":\"锦鲤化龙·冲天\"},{\"id\":3588,\"title\":\"镰鼬剃\"},{\"id\":13164,\"title\":\"银镰枪\"},{\"id\":9580,\"title\":\"跃龙门·怒波\"},{\"id\":6221,\"title\":\"焦钰\"},{\"id\":5827,\"title\":\"紫焰火尖枪\"},{\"id\":5122,\"title\":\"长虹\"},{\"id\":4575,\"title\":\"雪夜·清光引\"},{\"id\":3565,\"title\":\"建木\"},{\"id\":3517,\"title\":\"凌云志\"},{\"id\":15033,\"title\":\"通天戟\"},{\"id\":15498,\"title\":\"劫垢·堀\"},{\"id\":19902,\"title\":\"自动人形·四零式战术长枪\"},{\"id\":23864,\"title\":\"武道无穷·潜龙\"}]},{\"id\":531,\"title\":\"棍稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":10762,\"title\":\"戒律杖\"},{\"id\":7982,\"title\":\"打狗棒\"},{\"id\":6202,\"title\":\"仙山\"},{\"id\":15034,\"title\":\"2674·贰型电浆杖\"},{\"id\":17232,\"title\":\"倒马棍\"},{\"id\":21053,\"title\":\"学宫之杖\"},{\"id\":23869,\"title\":\"武道无穷·封魔\"},{\"id\":25840,\"title\":\"护世四法·降魔\"},{\"id\":25907,\"title\":\"古格努斯杖\"}]},{\"id\":113,\"title\":\"匕首稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":2335,\"title\":\"化魄\"},{\"id\":655,\"title\":\"鹰吻\"},{\"id\":656,\"title\":\"残霄\"},{\"id\":1834,\"title\":\"华夏神兵·马首刀\"},{\"id\":3518,\"title\":\"鹤唳\"},{\"id\":3624,\"title\":\"破劫·千刃\"},{\"id\":7922,\"title\":\"仙舞\"},{\"id\":9556,\"title\":\"雪残梅\"},{\"id\":1833,\"title\":\"寻魂\"},{\"id\":15031,\"title\":\"2674·战栗\"},{\"id\":15500,\"title\":\"三更令\"},{\"id\":23861,\"title\":\"曼提柯尔之牙\"},{\"id\":23863,\"title\":\"桡尺刀\"},{\"id\":23862,\"title\":\"月尺刀\"},{\"id\":27918,\"title\":\"斗罗大陆·鬼雕神刀\"}]},{\"id\":1862,\"title\":\"扇稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":21038,\"title\":\"逍遥\"},{\"id\":21052,\"title\":\"铁羽\"},{\"id\":22934,\"title\":\"优昙华\"},{\"id\":23687,\"title\":\"武道无穷·两仪\"},{\"id\":23870,\"title\":\"叶底花\"},{\"id\":23871,\"title\":\"千堆雪\"}]},{\"id\":258,\"title\":\"双截棍稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":1830,\"title\":\"虎摆\"},{\"id\":1831,\"title\":\"玉矩\"},{\"id\":1832,\"title\":\"精武\"},{\"id\":2333,\"title\":\"降魔手\"},{\"id\":2334,\"title\":\"地火涌\"},{\"id\":2357,\"title\":\"九霄寒\"},{\"id\":4540,\"title\":\"破劫·飞金\"},{\"id\":4557,\"title\":\"镇魔杵\"},{\"id\":9432,\"title\":\"除岁\"},{\"id\":6213,\"title\":\"法持\"},{\"id\":4581,\"title\":\"衔谷\"},{\"id\":15032,\"title\":\"嘶风\"},{\"id\":17068,\"title\":\"西行劫·捣药杵\"},{\"id\":21036,\"title\":\"月瞳\"},{\"id\":23868,\"title\":\"傲骨\"},{\"id\":25839,\"title\":\"夔牛槌\"}]},{\"id\":391,\"title\":\"双刀稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17067,\"title\":\"西行劫·刮骨钩\"},{\"id\":16283,\"title\":\"无救\"},{\"id\":15501,\"title\":\"天威\"},{\"id\":13973,\"title\":\"美食家\"},{\"id\":13165,\"title\":\"西摩格镰\"},{\"id\":6212,\"title\":\"天之刑\"},{\"id\":6211,\"title\":\"祸忌\"},{\"id\":4578,\"title\":\"绝潮汐\"},{\"id\":4577,\"title\":\"破重云\"},{\"id\":4576,\"title\":\"新月\"},{\"id\":3589,\"title\":\"必安\"},{\"id\":19903,\"title\":\"复制体·凯妮的剑\"},{\"id\":20590,\"title\":\"夺帅\"},{\"id\":23688,\"title\":\"武道无穷·双蝶\"},{\"id\":25908,\"title\":\"天意\"}]},{\"id\":1415,\"title\":\"双戟稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17230,\"title\":\"观山海·水衡\"},{\"id\":17229,\"title\":\"不归\"},{\"id\":19458,\"title\":\"衔月\"},{\"id\":23382,\"title\":\"劫铸·锋\"},{\"id\":23689,\"title\":\"武道无穷·献月\"},{\"id\":25838,\"title\":\"护世四法·螭龙\"}]},{\"id\":2314,\"title\":\"横刀稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":23857,\"title\":\"错金刀\"},{\"id\":23858,\"title\":\"烛泪\"},{\"id\":23859,\"title\":\"无韵\"}]},{\"id\":115,\"title\":\"弓箭稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":10760,\"title\":\"青花\"},{\"id\":658,\"title\":\"腥红之月\"},{\"id\":659,\"title\":\"古月\"},{\"id\":660,\"title\":\"阴阳师·雅矢\"},{\"id\":661,\"title\":\"暝蛇引\"},{\"id\":1835,\"title\":\"狻猊吼\"},{\"id\":15499,\"title\":\"风驰弓\"},{\"id\":6200,\"title\":\"春水\"},{\"id\":3520,\"title\":\"日辉\"},{\"id\":19456,\"title\":\"仙毫\"},{\"id\":21037,\"title\":\"转轮弓\"},{\"id\":23380,\"title\":\"劫祸·涌\"},{\"id\":23865,\"title\":\"逆逢\"}]},{\"id\":114,\"title\":\"万刃轮稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":657,\"title\":\"穷奇\"}]},{\"id\":116,\"title\":\"远程稀有皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":17234,\"title\":\"千机弩(连弩)\"},{\"id\":15507,\"title\":\"雨歇(连弩)\"},{\"id\":662,\"title\":\"朱雀(连弩)\"},{\"id\":663,\"title\":\"青鸟(连弩)\"},{\"id\":1837,\"title\":\"乱风云(连弩)\"},{\"id\":4580,\"title\":\"狂啸(连弩)\"},{\"id\":2359,\"title\":\"影子武士·手里剑喷子(连弩)\"},{\"id\":21018,\"title\":\"平涛(连弩)\"},{\"id\":21017,\"title\":\"镇海(连弩)\"},{\"id\":664,\"title\":\"石中火(鸟铳)\"},{\"id\":15502,\"title\":\"金蝎(鸟铳)\"},{\"id\":665,\"title\":\"天心玉(鸟铳)\"},{\"id\":10758,\"title\":\"玉飞梭(鸟铳)\"},{\"id\":6209,\"title\":\"萤火(鸟铳)\"},{\"id\":4621,\"title\":\"猎犸铳(鸟铳)\"},{\"id\":1836,\"title\":\"出渊蛟(鸟铳)\"},{\"id\":23867,\"title\":\"引冰落(鸟铳)\"},{\"id\":16423,\"title\":\"西行劫·阴阳二气瓶(火炮)\"},{\"id\":666,\"title\":\"龙息(火炮)\"},{\"id\":667,\"title\":\"龙啸(火炮)\"},{\"id\":2250,\"title\":\"玄武(火炮)\"},{\"id\":1838,\"title\":\"吞海鲛(火炮)\"},{\"id\":17233,\"title\":\"观山海·嘉果花(火炮)\"},{\"id\":6205,\"title\":\"造景(火炮)\"},{\"id\":6204,\"title\":\"墨不归(火炮)\"},{\"id\":4579,\"title\":\"火罗卫(火炮)\"},{\"id\":2251,\"title\":\"貔貅吞宝(火炮)\"},{\"id\":3466,\"title\":\"竹霹雳(火炮)\"},{\"id\":17235,\"title\":\"虎踞(五眼铳)\"},{\"id\":6216,\"title\":\"鹦鹉螺(五眼铳)\"},{\"id\":6215,\"title\":\"炉中火(五眼铳)\"},{\"id\":3519,\"title\":\"星追月(五眼铳)\"},{\"id\":1839,\"title\":\"心魔(五眼铳)\"},{\"id\":1840,\"title\":\"梦魇(五眼铳)\"},{\"id\":23122,\"title\":\"长歌诗韵·夜观灯(五眼铳)\"},{\"id\":23866,\"title\":\"赤霞(五眼铳)\"},{\"id\":668,\"title\":\"莲心剑雨(一窝蜂)\"},{\"id\":669,\"title\":\"炎魔(喷火筒)\"}]},{\"id\":117,\"title\":\"专属饰品皮\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":16267,\"title\":\"西行劫·神君印(岳山变身器)\"},{\"id\":28429,\"title\":\"珥冰(天海变身器)\"},{\"id\":4627,\"title\":\"龙门·石龛造像(天海变身器)\"},{\"id\":5826,\"title\":\"炎烈珠(季沧海变身器)\"},{\"id\":7983,\"title\":\"神乌造像(天海变身器)\"},{\"id\":13962,\"title\":\"2674·初代机(沈妙变身器)\"},{\"id\":22936,\"title\":\"彩佣娃娃(妖刀姬奥义特效)\"},{\"id\":22935,\"title\":\"剪纸·彩刀(妖刀姬特效)\"},{\"id\":22926,\"title\":\"观山海·春木(殷紫萍特效)\"},{\"id\":2252,\"title\":\"劫杯·战神（头部装扮）\"},{\"id\":1841,\"title\":\"将星锦鲤（头部装扮）\"},{\"id\":3521,\"title\":\"一品红（宁红叶头部）\"},{\"id\":1846,\"title\":\"豹耳（宁红叶头部）\"},{\"id\":2253,\"title\":\"委蛇朱冠（宁红叶头部）\"},{\"id\":2254,\"title\":\"昆仑龙神冠（宁红叶头部）\"},{\"id\":2255,\"title\":\"无明赤练（宁红叶娃娃）\"},{\"id\":674,\"title\":\"业火残红笛(宁红夜腰饰)\"},{\"id\":2256,\"title\":\"摇清枫(宁红夜后腰)\"},{\"id\":1845,\"title\":\"豹尾(宁红夜后腰)\"},{\"id\":4648,\"title\":\"魂花耀（宁红夜面部）\"},{\"id\":3594,\"title\":\"雁羽坠(宁红夜左前腰)\"},{\"id\":675,\"title\":\"雾隐繁花(宁红夜面具)\"},{\"id\":4571,\"title\":\"通九阴（宁红夜面部）\"},{\"id\":4556,\"title\":\"万象·火烬（宁红夜面部）\"},{\"id\":2336,\"title\":\"深渊蛱蝶（宁红叶面部)\"},{\"id\":2257,\"title\":\"怒狼铜盔（特木尔头部）\"},{\"id\":1844,\"title\":\"虎头帽（特木尔头部）\"},{\"id\":4572,\"title\":\"天狼盔（特木尔头部）\"},{\"id\":2258,\"title\":\"战狼弯角盔（特木尔头部）\"},{\"id\":676,\"title\":\"狼首腰扣(特木尔腰饰)\"},{\"id\":2259,\"title\":\"御狼号角（特木尔左前腰）\"},{\"id\":2260,\"title\":\"苍狼（特木尔左前腰）\"},{\"id\":677,\"title\":\"唤狼啸月号（特木尔左前腰）\"},{\"id\":2261,\"title\":\"雪绒帽(迦南头部)\"},{\"id\":672,\"title\":\"兔耳(迦南头部)\"},{\"id\":5825,\"title\":\"苍鹰之羽（迦南头部）\"},{\"id\":2262,\"title\":\"魅灵孤鹰（迦南娃娃）\"},{\"id\":678,\"title\":\"金羽六角铃（迦南右后腰）\"},{\"id\":2337,\"title\":\"阿丁神灯（迦南右后腰）\"},{\"id\":4559,\"title\":\"流火（迦南左前腰）\"},{\"id\":673,\"title\":\"兔尾（迦南后腰）\"},{\"id\":679,\"title\":\"金风玉露（迦南面部）\"},{\"id\":3593,\"title\":\"龙门·枳由罗（迦南背部）\"},{\"id\":2263,\"title\":\"瑞狮头（季沧海头部）\"},{\"id\":2264,\"title\":\"雪鹿雄角（季沧海头部）\"},{\"id\":2265,\"title\":\"醒狮头（季沧海头部）\"},{\"id\":2266,\"title\":\"浪焰青藤帽（季沧海头部）\"},{\"id\":2267,\"title\":\"烈豪（季沧海娃娃）\"},{\"id\":2268,\"title\":\"火石袋（季沧海右后腰）\"},{\"id\":4624,\"title\":\"山樱之鞘（季沧海右腰）\"},{\"id\":680,\"title\":\"火之三昧（季沧海背部）\"},{\"id\":2269,\"title\":\"红玉壶（季沧海右腰）\"},{\"id\":1842,\"title\":\"蓝螭匏（季沧海右腰）\"},{\"id\":3592,\"title\":\"瑞火壶(季沧海左后腰)\"},{\"id\":5830,\"title\":\"庖丁·灶燎（季沧海面部）\"},{\"id\":1843,\"title\":\"碧玉髓（季沧海面部）\"},{\"id\":2270,\"title\":\"福虎帽（胡桃头部）\"},{\"id\":3500,\"title\":\"幻狸（胡桃头部）\"},{\"id\":576,\"title\":\"灵狐耳(胡桃头部)\"},{\"id\":578,\"title\":\"银姬小帽(胡桃头部)\"},{\"id\":4560,\"title\":\"夏日派对·独角兽（胡桃前腰）\"},{\"id\":4625,\"title\":\"月玉枝（胡桃左腰）\"},{\"id\":3522,\"title\":\"破魔矢（胡桃右腰）\"},{\"id\":2271,\"title\":\"阴阳师（胡桃娃娃）\"},{\"id\":577,\"title\":\"阴阳灵狐(胡桃后腰)\"},{\"id\":2272,\"title\":\"蓝樱灯（胡桃左腰）\"},{\"id\":2273,\"title\":\"云游者（天海娃娃）\"},{\"id\":2338,\"title\":\"炎流云禅笠（天海头部）\"},{\"id\":2274,\"title\":\"醍醐灌顶（天海右后腰）\"},{\"id\":3547,\"title\":\"龙门·摩崖光（天海背部）\"},{\"id\":681,\"title\":\"青莲唤云铃（天海右后腰）\"},{\"id\":682,\"title\":\"大光相（天海背部）\"},{\"id\":2275,\"title\":\"妖刀姬（妖刀姬娃娃）\"},{\"id\":2276,\"title\":\"纸人·姑获鸟（妖刀姬左前腰）\"},{\"id\":2277,\"title\":\"纸人·妖刀姬（妖刀姬左前腰）\"},{\"id\":2278,\"title\":\"雪鹿雌角（崔三娘头部）\"},{\"id\":670,\"title\":\"珊瑚龙角（崔三娘头部）\"},{\"id\":4626,\"title\":\"夏日派对·遮阳镜（崔三娘面部）\"},{\"id\":2279,\"title\":\"雾海龙王（崔三娘娃娃）\"},{\"id\":671,\"title\":\"婵娟（崔三娘背饰）\"},{\"id\":2280,\"title\":\"出岚云岫（崔三娘右腰）\"},{\"id\":3548,\"title\":\"华夏宝甲·归正（岳山头部）\"},{\"id\":2360,\"title\":\"华夏宝甲·汉荣（岳山头部）\"},{\"id\":2339,\"title\":\"约誓盔（岳山头部）\"},{\"id\":2281,\"title\":\"青龙盔（岳山面部）\"},{\"id\":2282,\"title\":\"凤尾皂金盔（岳山面部）\"},{\"id\":2283,\"title\":\"武威侯（岳山娃娃）\"},{\"id\":2340,\"title\":\"云鹤冠（无尘头部）\"},{\"id\":2284,\"title\":\"妙法通玄（无尘娃娃）\"},{\"id\":2285,\"title\":\"摄魂铃（无尘右后腰）\"},{\"id\":2286,\"title\":\"金沙·太阳神鸟（无尘背部）\"},{\"id\":2287,\"title\":\"天官玉（无尘右腰）\"},{\"id\":3549,\"title\":\"星宿仪（无尘左前腰）\"},{\"id\":3523,\"title\":\"雪笠（顾清寒头部）\"},{\"id\":3524,\"title\":\"琼花帽（顾清寒头部）\"},{\"id\":2352,\"title\":\"冰雁（顾清寒娃娃）\"},{\"id\":5847,\"title\":\"寒兔（顾清寒头部）\"},{\"id\":2353,\"title\":\"月梦（顾清寒左前腰）\"},{\"id\":4591,\"title\":\"雪猫耳（顾清寒头部）\"},{\"id\":4590,\"title\":\"雪猫尾（顾清寒后腰）\"},{\"id\":5120,\"title\":\"夏日派对·遮阳帽（顾清寒头部）\"},{\"id\":3338,\"title\":\"寒酥银粟（顾清寒头部）\"},{\"id\":3468,\"title\":\"狼耳（特木尔头部）\"},{\"id\":3467,\"title\":\"狼尾（特木尔后缀）\"},{\"id\":3525,\"title\":\"上侍帽（武田信忠头部）\"},{\"id\":3526,\"title\":\"末路之鬼（武田信忠娃娃）\"},{\"id\":3527,\"title\":\"怨灵般若（武田信忠右后腰）\"},{\"id\":3528,\"title\":\"丑寅面（武田信忠面部）\"},{\"id\":3590,\"title\":\"暮光兜（武田信忠头部）\"},{\"id\":3591,\"title\":\"夕暮面（武田信忠面部）\"},{\"id\":4573,\"title\":\"花间点缀（殷紫萍左前腰）\"},{\"id\":4611,\"title\":\"龙葵拂（殷紫萍右前腰）\"},{\"id\":5572,\"title\":\"花间点萼（殷紫萍左前腰）\"},{\"id\":7924,\"title\":\"麟鹿兜（武田信忠头部）\"},{\"id\":7925,\"title\":\"百战·斩棘盔（岳山头部）\"},{\"id\":9100,\"title\":\"龙火坛（季沧海左前腰）\"},{\"id\":7926,\"title\":\"炼劫·金盏（宁红夜面部）\"},{\"id\":7927,\"title\":\"紫雾沙漏（迦南背部）\"},{\"id\":9099,\"title\":\"圣鹰纱（迦南面部）\"},{\"id\":9102,\"title\":\"异域弯刀（岳山右腰）\"},{\"id\":7961,\"title\":\"骇人面具（武田信忠右后腰）\"},{\"id\":9103,\"title\":\"降魔钵·嗔（天海右后腰）\"},{\"id\":9101,\"title\":\"立乌帽（胡桃头部）\"},{\"id\":9105,\"title\":\"素心流光卷（殷紫萍右前腰）\"},{\"id\":9104,\"title\":\"镰鼬刃（武田信忠右腰）\"},{\"id\":7984,\"title\":\"妙法兜帽（沈妙头部）\"},{\"id\":7994,\"title\":\"锡杖（天海右前腰）\"},{\"id\":7995,\"title\":\"松鹤手杖（胡桃右前腰）\"},{\"id\":7996,\"title\":\"鲛人角（崔三娘头部）\"},{\"id\":7997,\"title\":\"鲛人尾（崔三娘背部）\"},{\"id\":9083,\"title\":\"砚台（殷紫萍头部）\"},{\"id\":9084,\"title\":\"凯旋盔（岳山头部）\"},{\"id\":9085,\"title\":\"伏魔杵（天海右前腰）\"},{\"id\":9086,\"title\":\"赤浪坛（崔三娘左前腰）\"},{\"id\":9087,\"title\":\"癸卯兔（顾清寒头部）\"},{\"id\":9526,\"title\":\"厌镇铃（无尘右后腰）\"},{\"id\":9527,\"title\":\"夜明灯（顾清寒左前腰）\"},{\"id\":9528,\"title\":\"武君（武田信忠背部）\"},{\"id\":9572,\"title\":\"浮元子（胡桃头部）\"},{\"id\":9573,\"title\":\"司幽（宁红夜面部）\"},{\"id\":10565,\"title\":\"嵌山锁（沈妙左后腰）\"},{\"id\":10566,\"title\":\"若虚仪（无尘左前腰）\"},{\"id\":10567,\"title\":\"灵兰（殷紫萍头部）\"},{\"id\":10568,\"title\":\"玉良护额（崔三娘头部）\"},{\"id\":13145,\"title\":\"2674·机车眼睛（季沧海面部\"},{\"id\":13146,\"title\":\"竹笙（殷紫萍右后腰）\"},{\"id\":13147,\"title\":\"毛毡笠（胡为头部）\"},{\"id\":13148,\"title\":\"飞狐帽（胡为头部）\"},{\"id\":13149,\"title\":\"海宴玉（崔三娘左前腰）\"},{\"id\":13150,\"title\":\"卧龙·吕布铁面（胡为面部）\"},{\"id\":13963,\"title\":\"2674·心尾（沈妙后腰）\"},{\"id\":13964,\"title\":\"2674·北海巨喵（沈妙头部）\"},{\"id\":13965,\"title\":\"2674·能源电池（季沧海左前\"},{\"id\":13966,\"title\":\"2674·目镜叄型（宁红夜面部\"},{\"id\":13967,\"title\":\"2674·梅花罐（顾清寒右后腰\"},{\"id\":13968,\"title\":\"万息铜钱（无尘面部）\"},{\"id\":15008,\"title\":\"2674·护目镜(顾清寒面部)\"},{\"id\":15478,\"title\":\"海月(崔三娘右腰)\"},{\"id\":15479,\"title\":\"畲族·凤凰冠(顾清寒头部)\"},{\"id\":15480,\"title\":\"白菜头(胡桃头部)\"},{\"id\":15481,\"title\":\"暮云镜(顾清寒面部)\"},{\"id\":15482,\"title\":\"阳燧镜(顾清寒左腰)\"},{\"id\":15483,\"title\":\"寅客玉(胡为左腰)\"},{\"id\":15905,\"title\":\"莹玉绢(季沧海右前腰)\"},{\"id\":16271,\"title\":\"灵狐面(胡桃头部)\"},{\"id\":16270,\"title\":\"无祟(季莹莹头部)\"},{\"id\":16269,\"title\":\"西行劫·紫青铃(沈妙左前腰)\"},{\"id\":16268,\"title\":\"西行劫·紧箍儿(胡为头部)\"},{\"id\":16417,\"title\":\"西行劫·蛛丝坠(宁红夜右后腰)\"},{\"id\":16416,\"title\":\"端午龙(季沧海头部)\"},{\"id\":16415,\"title\":\"西行劫·卷帘将(天海头部)\"},{\"id\":16414,\"title\":\"春日序曲·雪糕(胡桃右前腰)\"},{\"id\":17056,\"title\":\"西行劫·悟能帽(特木尔)\"},{\"id\":17215,\"title\":\"观山海·冬棱(季莹莹头部)\"},{\"id\":17214,\"title\":\"观山海·秋金(胡为头部)\"},{\"id\":17213,\"title\":\"癸卯(宁红夜左前腰)\"},{\"id\":17212,\"title\":\"金辉袋(季沧海左前腰)\"},{\"id\":17211,\"title\":\"凶兽角杯(季沧海左后腰)\"},{\"id\":17210,\"title\":\"斗者之物(武田信忠面部)\"},{\"id\":19459,\"title\":\"自动人形·战术目镜(无尘面部)\"},{\"id\":19460,\"title\":\"观山海·夏鼓(季沧海右前腰)\"},{\"id\":19461,\"title\":\"自动人形·埃米尔(胡桃头部)\"},{\"id\":19462,\"title\":\"观山海·绯尾(沈妙后腰)\"},{\"id\":19463,\"title\":\"观山海·腓耳(沈妙头部)\"},{\"id\":19464,\"title\":\"观山海·鸾鲤(崔三娘右前腰)\"},{\"id\":19465,\"title\":\"瑾菀兰(玉玲珑右腰)\"},{\"id\":20320,\"title\":\"百战·天线(季莹莹头部)\"},{\"id\":21039,\"title\":\"日晷仪(无尘右后腰)\"},{\"id\":21040,\"title\":\"系云澜(沈妙头部)\"},{\"id\":21041,\"title\":\"醉狐银(玉玲珑面部)\"},{\"id\":21048,\"title\":\"琉璃火(季莹莹右前腰)\"},{\"id\":22925,\"title\":\"魔烛帽(殷紫萍头部)\"},{\"id\":22927,\"title\":\"游莹(季莹莹右前腰)\"},{\"id\":23106,\"title\":\"长歌诗韵·琵琶梳(迦南右前腰)\"},{\"id\":23107,\"title\":\"长歌成韵·戏鱼灯(胡桃右前腰)\"},{\"id\":23108,\"title\":\"长歌诗韵·军令状(岳山右后腰)\"},{\"id\":23109,\"title\":\"桃夭扇(殷紫萍右前腰)\"},{\"id\":23110,\"title\":\"鸠羽帽(哈迪头部)\"},{\"id\":23377,\"title\":\"溟祸(沈妙右前腰)\"},{\"id\":23690,\"title\":\"暖冬帽·男\"},{\"id\":23691,\"title\":\"暖冬帽·女\"},{\"id\":23872,\"title\":\"雁落笠(宁红夜头部)\"},{\"id\":23873,\"title\":\"武道无穷·明心(天海右后腰)\"},{\"id\":23874,\"title\":\"雪月笛(顾清寒右腰)\"},{\"id\":23875,\"title\":\"街头狂欢·嗷呜(沈妙右后腰)\"},{\"id\":23876,\"title\":\"街头狂欢·制胜之道(胡为头部)\"},{\"id\":23877,\"title\":\"武道无穷·无我(季莹莹面部)\"},{\"id\":23878,\"title\":\"烈阳羽(玉玲珑左前腰)\"},{\"id\":23879,\"title\":\"沐芳花篮(玉玲珑左前腰)\"},{\"id\":23880,\"title\":\"曜石面具(哈迪面部)\"},{\"id\":23881,\"title\":\"赤金镜(哈迪面部)\"},{\"id\":25499,\"title\":\"染红纱(宁红叶头部)\"},{\"id\":25580,\"title\":\"斗罗大陆·千手(特木尔面部)\"},{\"id\":25581,\"title\":\"斗罗大陆·柔骨(胡桃面部)\"},{\"id\":25850,\"title\":\"判官薄(魏轻右腰)\"},{\"id\":25849,\"title\":\"卫律冠(魏轻头部)\"},{\"id\":25848,\"title\":\"玄天冠(魏轻头部)\"},{\"id\":25847,\"title\":\"护世四法·天王印(季莹莹面部)\"},{\"id\":25846,\"title\":\"护世四法·宝伞(特木尔背部)\"},{\"id\":25845,\"title\":\"护世四法·狐貂(玉玲珑背部)\"},{\"id\":25844,\"title\":\"护世四法·琵琶(顾清寒背部)\"},{\"id\":25843,\"title\":\"银雪(顾清寒头部)\"},{\"id\":25842,\"title\":\"甲辰龙(季沧海头部)\"},{\"id\":25841,\"title\":\"吉星照(头部)\"},{\"id\":26009,\"title\":\"碎珠面纱(迦南面部)\"},{\"id\":25910,\"title\":\"探海镜(崔三娘右腰)\"},{\"id\":25909,\"title\":\"梨园传奇·五方冠(天海头部)\"},{\"id\":26014,\"title\":\"玉面判官(魏轻背部)\"},{\"id\":26013,\"title\":\"千机手(哈迪背部)\"},{\"id\":26012,\"title\":\"狂虎(胡为背部)\"},{\"id\":26011,\"title\":\"神机(沈妙背部)\"},{\"id\":26010,\"title\":\"殷紫萍(殷紫萍背部)\"},{\"id\":27917,\"title\":\"斗罗大陆·冬蝶(沈妙头部)\"},{\"id\":28430,\"title\":\"叠嶂宝鉴(魏轻左前腰)\"},{\"id\":28428,\"title\":\"护世四法·青光(季沧海背部)\"}]},{\"id\":269,\"title\":\"专属发型\",\"type\":\"checkbox\",\"new_type\":\"checkbox\",\"img_num\":0,\"is_required\":\"N\",\"course_title\":\"\",\"course_img\":\"\",\"val\":[{\"id\":2361,\"title\":\"【挑染】云霞（宁红夜发型）\"},{\"id\":2290,\"title\":\"阙光（宁红夜发型）\"},{\"id\":2291,\"title\":\"缥缈（宁红夜发型）\"},{\"id\":2292,\"title\":\"苍狼王族（特木尔发型）\"},{\"id\":2293,\"title\":\"军神·盖世（特木尔发型）\"},{\"id\":2294,\"title\":\"苍狼宗主（特木尔发型）\"},{\"id\":2295,\"title\":\"【挑染】凤姿（迦南发型）\"},{\"id\":2296,\"title\":\"雀翎（迦南发型）\"},{\"id\":6225,\"title\":\"夕鹰（迦南发型）\"},{\"id\":2298,\"title\":\"翔鸾（迦南发型）\"},{\"id\":2297,\"title\":\"朝颜（迦南发型）\"},{\"id\":3597,\"title\":\"龙门·化羽（迦南发型）\"},{\"id\":3469,\"title\":\"玉儿（迦南发型）\"},{\"id\":2362,\"title\":\"【挑染】腾烟（季沧海发型）\"},{\"id\":5831,\"title\":\"庖丁·炮炼（季沧海发型）\"},{\"id\":3489,\"title\":\"冲冠（季沧海发型）\"},{\"id\":2299,\"title\":\"逆水寒·江海（季沧海发型）\"},{\"id\":2300,\"title\":\"银杏（胡桃发型）\"},{\"id\":3596,\"title\":\"【挑染】水仙（胡桃发型）\"},{\"id\":2301,\"title\":\"木棉（胡桃发型）\"},{\"id\":2303,\"title\":\"【挑染】自在（天海发型）\"},{\"id\":2302,\"title\":\"灿莲花（天海发型）\"},{\"id\":6224,\"title\":\"法王（天海发型）\"},{\"id\":2304,\"title\":\"弄潮（崔三娘发型）\"},{\"id\":4622,\"title\":\"【挑染】沸海（崔三娘发型）\"},{\"id\":2305,\"title\":\"激浪（崔三娘发型）\"},{\"id\":6223,\"title\":\"安澜（崔三娘发型）\"},{\"id\":4585,\"title\":\"碎浪（崔三娘发型）\"},{\"id\":6222,\"title\":\"赤涛（崔三娘发型）\"},{\"id\":2306,\"title\":\"浩渺（崔三娘发型）\"},{\"id\":3470,\"title\":\"靖仇（岳山发型）\"},{\"id\":3595,\"title\":\"【挑染】觅封侯（岳山发型）\"},{\"id\":2307,\"title\":\"云长冠（岳山发型）\"},{\"id\":2308,\"title\":\"【挑染】羽客（无尘发型）\"},{\"id\":2341,\"title\":\"九梁（无尘发型）\"},{\"id\":3340,\"title\":\"逍遥（无尘发型）\"},{\"id\":3529,\"title\":\"冰凌（顾清寒发型）\"},{\"id\":4612,\"title\":\"天青（顾清寒发型）\"},{\"id\":3339,\"title\":\"灵儿（顾清寒发型）\"},{\"id\":4623,\"title\":\"【挑染】冰羽（顾清寒）\"},{\"id\":3530,\"title\":\"阎摩（武田信忠发型）\"},{\"id\":5123,\"title\":\"伏苓（殷紫萍）\"},{\"id\":4584,\"title\":\"子菀（殷紫萍发型）\"},{\"id\":9088,\"title\":\"天南（沈妙发型）\"},{\"id\":9089,\"title\":\"宫羽（顾清寒发型）\"},{\"id\":9090,\"title\":\"【挑染】白芷（殷紫萍发型）\"},{\"id\":9091,\"title\":\"【挑染】熛怒（季沧海发型）\"},{\"id\":11315,\"title\":\"漠月（特木尔发型）\"},{\"id\":4613,\"title\":\"月白（宁红夜发型）\"},{\"id\":10569,\"title\":\"月下香（胡桃发型）\"},{\"id\":10570,\"title\":\"百灵（沈妙发型）\"},{\"id\":10571,\"title\":\"竹律（无尘发型）\"},{\"id\":13151,\"title\":\"烈火（季沧海发型）\"},{\"id\":13152,\"title\":\"【挑染】忠嘉（武田信忠发型）\"},{\"id\":13153,\"title\":\"【挑染】千丝（沈妙发型）\"},{\"id\":9574,\"title\":\"苏木（殷紫萍发型）\"},{\"id\":15009,\"title\":\"漫游骇客(宁红夜发型)\"},{\"id\":16274,\"title\":\"【挑染】宵烛(季莹莹发型)\"},{\"id\":16273,\"title\":\"【挑染】清威(无尘发型)\"},{\"id\":16272,\"title\":\"西行劫·大圣(胡为发型)\"},{\"id\":16418,\"title\":\"西行劫·蛛缘(宁红夜发型)\"},{\"id\":17058,\"title\":\"西行劫·玉骨(迦南发型)\"},{\"id\":17057,\"title\":\"西行劫·望舒(顾清寒发型)\"},{\"id\":17219,\"title\":\"观山海·青鸾(迦南发型)\"},{\"id\":17218,\"title\":\"观山海·冥泉(季莹莹发型)\"},{\"id\":17217,\"title\":\"观山海·天刑(胡为发型)\"},{\"id\":17216,\"title\":\"斗者(武田信忠发型)\"},{\"id\":18075,\"title\":\"富春山居·晓山(顾清寒发型)\"},{\"id\":19466,\"title\":\"不蛊(玉玲珑发型)\"},{\"id\":19467,\"title\":\"【挑染】戾君(胡为发型)\"},{\"id\":19468,\"title\":\"观山海·炎野(季沧海发型)\"},{\"id\":19469,\"title\":\"观山海·夜游(崔三娘发型)\"},{\"id\":19470,\"title\":\"【挑染】商月(玉玲珑发型)\"},{\"id\":19471,\"title\":\"观山海·忘忧(沈妙发型)\"},{\"id\":20314,\"title\":\"百战·漆刃(季莹莹发型)\"},{\"id\":20313,\"title\":\"缘觉(天海发型)\"},{\"id\":21042,\"title\":\"流萤(玉玲珑发型)\"},{\"id\":21050,\"title\":\"韶光(沈妙发型)\"},{\"id\":21049,\"title\":\"古溪(玉玲珑发型)\"},{\"id\":22928,\"title\":\"观山海·春晖(殷紫萍发型)\"},{\"id\":23111,\"title\":\"【挑染】暮落(殷紫萍发型)\"},{\"id\":23112,\"title\":\"【挑染】师鬃(哈迪发型)\"},{\"id\":23113,\"title\":\"长歌诗韵·蓬舞(迦南发型)\"},{\"id\":23114,\"title\":\"长歌诗韵·星桥(胡桃发型)\"},{\"id\":23115,\"title\":\"砂砾(哈迪发型)\"},{\"id\":23375,\"title\":\"逆水寒·染(季沧海发型)\"},{\"id\":23376,\"title\":\"逆水寒·鸢(崔三娘发型)\"},{\"id\":23882,\"title\":\"月丹(胡桃发型)\"},{\"id\":23883,\"title\":\"霜天(顾清寒发型)\"},{\"id\":23884,\"title\":\"红绡(宁红夜发型)\"},{\"id\":23885,\"title\":\"啸风(胡为发型)\"},{\"id\":23886,\"title\":\"簪缨(宁红夜发型)\"},{\"id\":23887,\"title\":\"街头狂欢·撞色艺术(沈妙发型)\"},{\"id\":23888,\"title\":\"露华(玉玲珑发型)\"},{\"id\":25582,\"title\":\"斗罗大陆·海神(特木尔发型)\"},{\"id\":25583,\"title\":\"斗罗大陆·雀变(胡桃发型)\"},{\"id\":25857,\"title\":\"护世四法·妙音(季莹莹发型)\"},{\"id\":25856,\"title\":\"护世四法·威能(特木尔发型)\"},{\"id\":25855,\"title\":\"冷霜(顾清寒发型)\"},{\"id\":25854,\"title\":\"飒爽(魏轻发型)\"},{\"id\":25853,\"title\":\"护世四法·净天(玉玲珑发型)\"},{\"id\":25852,\"title\":\"【挑染】玄冥(魏轻发型)\"},{\"id\":25851,\"title\":\"【挑染】万仞山(岳山发型)\"},{\"id\":27915,\"title\":\"【挑染】斗罗大陆·龙蝶（沈妙发型）\"},{\"id\":27916,\"title\":\"【挑染】斗罗大陆·灵冰（胡为发型）\"},{\"id\":28427,\"title\":\"护世四法·慧善(季沧海发型)\"}]}]}\n";
        String data = JSONObject.parseObject(request).getString("data");
        List<JSONObject> array = JSONObject.parseArray(data, JSONObject.class);
        for (JSONObject jsonObject : array) {
            if (Objects.equals(jsonObject.getString("type"), "checkbox")) {

                //多选
                GameAttribute gameAttribute = new GameAttribute();
                gameAttribute.setGameId(12l);
                gameAttribute.setGameName("永劫无间");
                gameAttribute.setFieldName(jsonObject.getString("title"));
                gameAttribute.setSort(1);
                gameAttribute.setParentId(0l);
                gameAttribute.setCreateTime(new Date());
                gameAttributeService.insertGameAttribute(gameAttribute);

                gameAttribute.setAcode(String.valueOf(gameAttribute.getId()));
                gameAttributeService.updateGameAttribute(gameAttribute);

                String val = jsonObject.getString("val");
                List<JSONObject> values = JSONObject.parseArray(val, JSONObject.class);
                for (JSONObject value : values) {
                    //多选
                    GameAttribute gameAttribute1 = new GameAttribute();
                    gameAttribute1.setGameId(12l);
                    gameAttribute1.setGameName("永劫无间");
                    gameAttribute1.setFieldName(value.getString("title"));
                    gameAttribute1.setSort(1);
                    gameAttribute1.setParentId(gameAttribute.getId());
                    gameAttribute1.setCreateTime(new Date());
                    gameAttributeService.insertGameAttribute(gameAttribute1);

                    gameAttribute1.setAcode(gameAttribute.getAcode() + "," + gameAttribute1.getId());
                    gameAttributeService.updateGameAttribute(gameAttribute1);
                }
            }

        }

        return AjaxResult.success();
    }

    private static void commonValue(Elements goodDetails) {
        for (Element first : goodDetails) {
            String attr = first.select("a").attr("href");
            String goodsid = first.select("a").attr("data-goodsid");
            String goodsName = first.select("a").attr("data-goods-name");
            String recid = first.select("a").attr("data-recid");
            String publisher = first.select("a").attr("data-publisher");
            System.out.println(attr);
            System.out.println(recid);
            System.out.println(goodsid);
            System.out.println(goodsName);
            System.out.println(publisher);


            Elements badgesClass = first.getElementsByClass("goodsList-item-badges");
            Element first1 = badgesClass.first();
            if (Objects.nonNull(first1)) {
                Elements elementsByClass1 = first1.getElementsByClass("left-footer-tag-text");
                Element first2 = elementsByClass1.first();
                String re = first2.select("span").text();
                System.out.println(re);
            }
            boolean b = true;
            int i = 15;
            while (b) {
                Elements select = first.getElementsByClass("integer-part price-" + i);
                if (!CollectionUtils.isEmpty(select)) {
                    b = false;
                    Element f = select.first();
                    String text = f.text();
                }
                if (i > 25) {
                    b = false;
                }
                i++;
            }

        }
    }

    @Resource
    private GameAttributeMapper gameAttributeMapper;

    //游戏数据查询
    @GetMapping("/gameInfo")
    public AjaxResult getGameInfoAndAttrTemp(Long id) {
        List<GameAttribute> list = new ArrayList<>();
        GameAttribute attribute = new GameAttribute();
        attribute.setGameId(id);
        List<GameAttribute> attributes = gameAttributeMapper.selectGameAttributeList(attribute);
        // 获取 parentId 为0 的
        List<GameAttribute> parent0 =
                attributes.stream().filter(s -> s.getParentId().equals(0L)).collect(Collectors.toList());
        for (GameAttribute gameAttribute : parent0) {
            List<GameAttribute> parent1 =
                    attributes.stream().filter(s -> s.getParentId().equals(gameAttribute.getId())).collect(Collectors.toList());
            if (!CollectionUtils.isEmpty(parent1)) {
                for (GameAttribute attribute1 : parent1) {
                    List<GameAttribute> parent2 =
                            attributes.stream().filter(s -> s.getParentId().equals(attribute1.getId())).collect(Collectors.toList());
                    if (!CollectionUtils.isEmpty(parent2)) {
                        for (GameAttribute attribute2 : parent2) {
                            List<GameAttribute> parent3 =
                                    attributes.stream().filter(s -> s.getParentId().equals(attribute2.getId())).collect(Collectors.toList());
                            if (!CollectionUtils.isEmpty(parent3)) {
                                for (GameAttribute attribute3 : parent3) {
                                    List<GameAttribute> parent4 =
                                            attributes.stream().filter(s -> s.getParentId().equals(attribute3.getId())).collect(Collectors.toList());
                                    attribute3.setChildGameAttributes(parent4);
                                }
                            }
                            attribute2.setChildGameAttributes(parent3);
                        }
                    }
                    attribute1.setChildGameAttributes(parent2);
                }
            }
            gameAttribute.setChildGameAttributes(parent1);
            list.add(gameAttribute);
        }
        return AjaxResult.success(list);
    }

    @GetMapping("/saveGameAtt")
    public void saveGameAtt(Long parentId) {
        StringBuffer buffer = new StringBuffer();

        File file = new File("D:\\文档\\json.json");

        String encoding = "utf-8";
        try (InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);
             BufferedReader bufferedReader = new BufferedReader(read)) {
            //判断文件是否存在
            if (file.isFile() && file.exists()) {
                String lineTxt;
                while ((lineTxt = bufferedReader.readLine()) != null) {
//                    log.info(lineTxt);
                    buffer.append(lineTxt);
                }
            } else {
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        String str = buffer.toString();
        List<JSONObject> array = JSONObject.parseArray(str, JSONObject.class);
        if (CollectionUtils.isEmpty(array)) {
            return;
        }
        GameAttribute attribute = new GameAttribute();
        attribute.setParentId(parentId);
        List<GameAttribute> gameAttributes = gameAttributeService.selectGameAttributeList(attribute);
        if (!CollectionUtils.isEmpty(gameAttributes)) {
            List<String> collect = gameAttributes.stream().map(s -> s.getSid()).collect(Collectors.toList());
            Map<String, List<GameAttribute>> listMap = gameAttributes.stream().collect(Collectors.groupingBy(s -> s.getFieldName()));

            for (JSONObject json : array) {
                if (collect.contains(json.getString("sid"))) {
                    if (Objects.nonNull(listMap.get(json.getString("fieldName")))) {
                        continue;
                    }
                }
                if (StringUtils.isEmpty(json.getString("sid"))) {
                    continue;
                }
                GameAttribute gameAttribute = new GameAttribute();

                if (CollectionUtils.isEmpty(listMap.get(json.getString("fieldName")))) {
                    gameAttribute.setParentId(parentId);
                    gameAttribute.setGameId(json.getLong("gameId"));
                    gameAttribute.setGameName(json.getString("gameName"));
                    gameAttribute.setFieldName(json.getString("fieldName"));
                    gameAttribute.setSid(json.getString("sid"));
                    gameAttribute.setImgUrl(json.getString("imgUrl"));
                    gameAttribute.setCreateTime(new Date());
                    gameAttributeMapper.insertGameAttribute(gameAttribute);
                    gameAttribute.setAcode(parentId + "," + gameAttribute.getId());
                } else {
                    gameAttribute = listMap.get(json.getString("fieldName")).get(0);
                }
                gameAttribute.setSid(json.getString("sid"));
                gameAttribute.setImgUrl(json.getString("imgUrl"));
                gameAttributeMapper.updateGameAttribute(gameAttribute);
            }
        }
    }
}
